You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+53-5
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,53 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
## [1.3.0][1.3.0] - 2025-04-19
8
+
9
+
- The formatting of the `message` XML element has changed. If a log event is coming from `Microsoft.Extensions.Logging`, then the message is now formatted by switching off quoting of strings. The formatting of properties remains unchanged.
SELECT COUNT(*) FROM "sqlite_master" WHERE "type" = 'table' AND "rootpage" IS NOT NULL;</message>
38
+
</event>
39
+
```
40
+
41
+
- The message formatting behaviour can be configured with the new `UseMessageFormatter()` method of the options' builder. For example, all log events with the `UppercaseMessage` property set to `true` can have their messages uppercased.
- Add support for .NET 8 and mark `Serilog.Formatting.Log4Net` as [trimmable](https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained) for [AOT compatibility](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/).
- Converted the `LineEndingExtensions` class from public to internal
41
88
- Improve log4j compatibility mode: don't write the `xmlns:log4j` attribute to be [exactly compatible](https://github.com/apache/log4j/blob/v1_2_17/src/main/java/org/apache/log4j/xml/XMLLayout.java#L137-L145) with log4j
Copy file name to clipboardExpand all lines: README.md
+30
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,36 @@ Running this app writes the following XML events into the `logs.xml` file in the
60
60
61
61
You can configure `Log4NetTextFormatter` in multiple ways, the fluent options builder will help you discover all the possibilities.
62
62
63
+
### Message formatting
64
+
65
+
Since version 1.3.0, the contents of the `message` XML elements can be customized by using the new `UseMessageFormatter` method. For example, to always [format the message](https://github.com/serilog/serilog/wiki/Formatting-Output) by switching off quoting of strings, use this:
See also the [release notes](CHANGELOG.md) of version 1.3.0 for a concrete example of what changed from previous versions.
92
+
63
93
### Exception formatting
64
94
65
95
By default, Log4NetTextFormatter formats exception by calling [ToString()](https://docs.microsoft.com/en-us/dotnet/api/system.exception.tostring). You can customise this behaviour by setting your own formatting delegate. For example, you could use [Ben.Demystifier](https://github.com/benaadams/Ben.Demystifier/) like this:
0 commit comments