All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.0 - Unreleased
- Breaking Change: Drop support for .NET 6 which ended on November 12, 2024. Note that .NET Standard 2.0 is still supported.
1.4.0 - 2025-09-19
- Properties whose values are
nullare now always serialized with avalueattribute. Thanks to @southernprogrammer for reporting this issue. See the Null text documentation in the README for more information.
Before (1.3.1)
<log4net:properties>
<log4net:data name="key" />
</log4net:properties>After (1.4.0)
<log4net:properties>
<log4net:data name="key" value="(null)" />
</log4net:properties>1.3.1 - 2025-04-30
- Log events coming from
Microsoft.Extensions.Loggingare now identified if they have either anEventId.Idor anEventId.Nameproperty. Previously, log events coming fromMicrosoft.Extensions.Loggingwere identified if they had both anIdand aNameproperty.
1.3.0 - 2025-04-19
- The formatting of the
messageXML element has changed. If a log event is coming fromMicrosoft.Extensions.Logging, then the message is now formatted by switching off quoting of strings. The formatting of properties remains unchanged.
Before (1.2.0)
<event logger="Microsoft.EntityFrameworkCore.Database.Command" timestamp="2003-01-04T15:09:26.535+01:00" level="INFO">
<properties>
<data name="elapsed" value="10" />
<!-- ... -->
<data name="EventId.Id" value="20101" />
<data name="EventId.Name" value="Microsoft.EntityFrameworkCore.Database.Command.CommandExecuted" />
</properties>
<message>Executed DbCommand ("10"ms) [Parameters=[""], CommandType='Text', CommandTimeout='30']"
""SELECT COUNT(*) FROM \"sqlite_master\" WHERE \"type\" = 'table' AND \"rootpage\" IS NOT NULL;"</message>
</event>After (1.3.0)
<event logger="Microsoft.EntityFrameworkCore.Database.Command" timestamp="2003-01-04T15:09:26.535+01:00" level="INFO">
<properties>
<data name="elapsed" value="10" />
<!-- ... -->
<data name="EventId.Id" value="20101" />
<data name="EventId.Name" value="Microsoft.EntityFrameworkCore.Database.Command.CommandExecuted" />
</properties>
<message>Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT COUNT(*) FROM "sqlite_master" WHERE "type" = 'table' AND "rootpage" IS NOT NULL;</message>
</event>- The message formatting behaviour can be configured with the new
UseMessageFormatter()method of the options' builder. For example, all log events with theUppercaseMessageproperty set totruecan have their messages uppercased.
var formatter = new Log4NetTextFormatter(options => options.UseMessageFormatter((logEvent, formatProvider) =>
{
if (logEvent.Properties.TryGetValue("UppercaseMessage", out var up) && up is ScalarValue { Value: true })
{
return logEvent.RenderMessage(formatProvider).ToUpperInvariant();
}
return logEvent.RenderMessage(formatProvider);
}));1.2.0 - 2024-09-10
- Add support for .NET 8 and mark
Serilog.Formatting.Log4Netas trimmable for AOT compatibility.
1.1.0 - 2023-05-02
- Add support for caller information (class, method, file, line) through the Serilog.Enrichers.WithCaller package.
1.0.2 - 2023-02-11
- Add a new
Log4NetTextFormatter.Log4JFormatterstatic property which is configured for the log4j XML layout. This static property is also useful when using the Serilog.Settings.Configuration package where it can be used with the following accessor:
Serilog.Formatting.Log4Net.Log4NetTextFormatter::Log4JFormatter, Serilog.Formatting.Log4Net
1.0.1 - 2023-01-17
- Add support for .NET 6. It will be beneficial for string interpolation which is used extensively through the project. See Are there benefits in producing a .NET 6.0 version of a .NET Standard 2.0 library? on Stack Overflow.
1.0.0 - 2022-03-08
- First final version (i.e. non pre-release) which is identical to 1.0.0-rc.4
1.0.0-rc.4 - 2021-11-02
- Add README and release notes (link to https://github.com/serilog-contrib/serilog-formatting-log4net/blob/main/CHANGELOG.md) in the NuGet package
1.0.0-rc.3 - 2021-10-25
- Replace
UseLog4NetXmlNamespace(null)withUseNoXmlNamespace() - Reduce the public API surface
- Removed all property getters on
Log4NetTextFormatterOptionsBuilder - Converted the
LineEndingExtensionsclass from public to internal
- Removed all property getters on
- Improve log4j compatibility mode: don't write the
xmlns:log4jattribute to be exactly compatible with log4j
Before (1.0.0-rc.2)
<log4j:event timestamp="1041689366535" level="INFO" xmlns:log4j="http://jakarta.apache.org/log4j/">
<log4j:message><![CDATA[Hello from Serilog]]></log4j:message>
</log4j:event>After (1.0.0-rc.3)
<log4j:event timestamp="1041689366535" level="INFO">
<log4j:message><![CDATA[Hello from Serilog]]></log4j:message>
</log4j:event>1.0.0-rc.2 - 2021-03-25
- Handle non Serilog provided
LogEventPropertyValuesubclasses - The
Log4NetTextFormatterOptionsBuilderconstructor is now internal - Include the index in the property name when formatting a SequenceValue
Before (1.0.0-rc.1)
<log4net:data name="Args" value="--first-argument" />
<log4net:data name="Args" value="--second-argument" />After (1.0.0-rc.2)
<log4net:data name="Args[0]" value="--first-argument" />
<log4net:data name="Args[1]" value="--second-argument" />- Documentation has been improved
1.0.0-rc.1 - 2021-02-05
This release contains the same code as 1.0.0-alpha.0.110.
Still trying to figure out how to make everything fit together with MinVer, annotated tags and GitHub actions.
1.0.0-alpha.0.110 - 2021-02-04
- Implement log4j compatibility mode.