Upgrading Serilog 2 to 3
Breaking2.12.0 → 3.1.1Breaking4New1Changed4Fixed2Other4
Fetching 109 releases from GitHub…2 / 109
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- Log events now automatically carry trace and span ids from the current activity, so logging back-ends can correlate logs with distributed traces.
- Optimizes property value converters, changing their behavior.
- Logs nint and nuint (IntPtr and UIntPtr) as scalars instead of structures.
Must act 3 items need code or config changes
Target frameworks requirement changed in 3.0.0-dev-01885: .NETFramework4.5, .NETFramework4.6, .NETFramework4.7, .NETStandard1.0, .NETStandard1.3, .NETStandard2.0, .NETStandard2.1, net5.0, net6.0 → .NETFramework4.6.2, .NETFramework4.7.1, .NETStandard2.0, .NETStandard2.1, net5.0, net6.0, net7.0.
What you must change
Breaking3
Collects and propagates Activity.Current.TraceId and SpanId automatically in Logger.Write().
Activity.Current.TraceIdSpanIdLogger.Write()LogEvent.TraceIdLogEvent.SpanId{TraceId}{SpanId}Optimizes property value converters, changing their behavior.
Logs nint and nuint (IntPtr and UIntPtr) as scalars instead of structures.
nintnuintIntPtrUIntPtr