Skip to content

Conversation

@dependabot
Copy link

@dependabot dependabot bot commented on behalf of github Nov 12, 2025

⚠️ Dependabot is rebasing this PR ⚠️

Rebasing might not happen immediately, so don't worry if this takes some time.

Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


Updated Serilog from 2.0.0 to 4.0.0.

Release notes

Sourced from Serilog's releases.

4.0.0

What's new in Serilog 4.0.0?

If you're deploying to .NET Framework, note that Serilog's assembly version number has been unpinned from the long-running historical 2.0.0 default, and now matches the package version precisely. If you encounter issues, ensure your build is generating valid assembly binding redirects.

Simple, robust, built-in batching support

Sinks that need batching functionality can now be easily written, without any additional package dependencies, by implementing IBatchedLogEventSink:

class MyBatchedSink: IBatchedLogEventSink
{
    public Task EmitBatchAsync(IReadOnlyCollection<LogEvent> batch)
    {
        // Send a batch of log events...
    }
}

Batched sinks can be added using WriteTo.Sink(IBatchedLogEventSink, ...) - they're given first-class consideration just like regular un-batched sinks.

The built-in batching implementation is based on System.Threading.Channels and draws on the original Serilog.Sinks.PeriodicBatching package (now in maintenance-mode), to provide a full-featured, efficient, async-native batching implementation.

Experimental dotted name capturing

By setting an experimental AppContext switch, message templates can be used to capture dotted names, which are required when using some logging schemas.

AppContext.SetSwitch("Serilog.Parsing.MessageTemplateParser.AcceptDottedPropertyNames", true);

Log.Information("Running as {user.name}", Environment.UserName);
// Captures {"user.name": "nblumhardt"}

While currently experimental and unsupported, this flag is intended to help the ecosystem evaluate and prepare for dotted name support in a future Serilog release.

Changes

  • #​2015 — breaking unpin assembly version (@​nblumhardt)
  • #​2045 — breaking use case-insensitive matching for level overrides (@​tillig)
  • #​2051 — breaking recognize UtcTimestamp as a built-in token in output templates (@​MatthewHays)
  • #​1979 — add tests for ReusableStringWriter (@​nblumhardt)
  • #​2016 — update TFMs (@​nblumhardt, @​bartelink)
  • #​2018 — add LogEvent.UnstableAssembleFromParts() (@​nblumhardt)
  • #​2044 — build updates for compatibility (@​tillig)
  • #​2027 — improve trimming annotations, compatibility switch for compiler-generated type support (@​agocke)
  • #​2055 — introduce IBatchedLogEventSink and WriteTo.Sink(IBatchedLogEventSink) (@​nblumhardt)
  • #​2060 — introduce LoggerSinkConfiguration.CreateSink() and redesign .Wrap() (@​nblumhardt, @​bartelink)
  • #​2063 — improve MessageTemplateParser performance, switch to allow . in captured property names (@​nblumhardt)
  • #​2064 — make message template alignment parsing match spec (@​Insomniak47)
  • #​2065 — allow any character except } in message template format specifiers (@​Insomniak47)
    ... (truncated)

3.1.1

  • #​1977 - don't stack overflow when disposing ReusableStringWriter with large renderings (@​nblumhardt)

This is a bugfix for release 3.1.0.

3.1.0

  • #​1935 - remove CHANGES.md (@​sungam3r)
  • #​1936, #​1922 - README.md updates (@​nblumhardt)
  • #​1942 - remove redundant GetTypeInfo() calls (@​SimonCropp)
  • #​1947 - message template caching performance improvements (@​epeshk)
  • #​1948 - reduce allocations in Logger.Write() (@​epeshk)
  • #​1955 breaking - collect and propagate Activity.Current.TraceId and SpanId automatically in Logger.Write() (@​nblumhardt)
  • #​1959 - breaking - property value converter optimizations (@​epeshk)
  • #​1964 - don't cache reusable string writers with large buffer sizes (@​Jakimar)
  • #​1969 - README.md updates (@​bartelink)
  • #​1971 - drop test coverage for unsupported .NET Core versions (@​bartelink)

Built-in trace and span id support

This release adds two new first-class properties to LogEvent: TraceId and SpanId. These are set automatically in Logger.Write() to the corresponding property values from System.Diagnostics.Activity.Current.

The major benefit of this change is that sinks, once updated, can reliably propagate trace and span ids through to back-ends that support them (in much the same way that first-class timestamps, messages, levels, and exceptions are used today).

The sinks maintained under serilog/serilog, along with formatting helpers such as Serilog.Formatting.Compact and Serilog.Expressions, are already compatible with this change or have pending releases that add compatibility.

Dropped .NET Core 2.1 and 3.0 support

On .NET Core 2.1 and 3.0, projects targeting Serilog 3.1+ will fail to build, with:

/project/packages/system.runtime.compilerservices.unsafe/6.0.0/buildTransitive/netcoreapp2.0
/System.Runtime.CompilerServices.Unsafe.targets(4,5): error : System.Runtime.CompilerServices.Unsafe
doesn't support netcoreapp2.1. Consider updating your TargetFramework to netcoreapp3.1 or later.

Affected consumers should continue to use Serilog 3.0 or earlier. See serilog/serilog#1983 for a discussion of this issue.

Technical breaking changes

Trace and span id placeholders

Trace and span id collection includes support for {TraceId} and {SpanId} placeholders in output templates (commonly used when formatting text log files). Where previously these names resolved to user-defined properties, they now resolve to the built-in LogEvent.TraceId and LogEvent.SpanId values, respectively.

Impact is expected to be low/zero, because the trace and span id values in any user-added properties are almost certainly identical to the built-in ones.

nint and nuint (IntPtr and UIntPtr) handling

These integer types were previously logged as structures. They're now correctly logged as scalars.

3.0.1

  • #​1926 - fix JsonFormatter output for renderMessage = true (@​nblumhardt)

3.0.0

What's new in 3.0.0?

Target framework changes - Serilog no longer targets netstandard1.x or .NET Framework versions earlier than .NET 4.6.2. Users on affected frameworks should continue to target Serilog 2.12.x.

Removed obsolete APIs - Many deprecated/obsolete types and functions have been removed. Notably, JsonFormatter can no longer be subclassed (either port to JsonValueFormatter, use Serilog.Expressions, or copy the original JsonFormatter code into your project).

Added APIs - LevelAlias.Off is now provided as an equivalent to Microsoft.Extensions.Logging's LogLevel.Off; Destructure.AsDictionary<T>() can now be used to mark dictionary types.

Fewer allocations on many hot paths - A lot of work has gone into avoiding heap allocations wherever possible.

Changes

2.12.0

Highlights of 2.12.0

Improved and expanded <Nullable>enable</Nullable> support

A huge number of commits have gone into completing and refining non-null reference type annotations, which now cover the entire public Serilog API. The Serilog project itself now builds with non-null reference type checking globally enabled 🎉

IAsyncDisposable support

Sinks that need to flush changes using asynchronous APIs can now implement IAsyncDisposable and prevent the possibility of deadlocking while waiting for tasks to complete.

To drive this, Logger can now be disposed via using async:

await using var log = new LoggerConfiguration().CreateLogger();

and the Log class provides Log.CloseAndFlushAsync():

await Log.CloseAndFlushAsync();

DateOnly and TimeOnly support

The DateOnly and TimeOnly types introduced in .NET 6 are now correctly handled as scalar values when capturing.

Merged PRs

  • #​1713, #​1716, #​1715, #​1722, #​1721, #​1720, #​1729 - improved non-null reference type annotations (@​SimonCropp)
  • #​1702 - DateOnly and TimeOnly support (@​SimonCropp)
  • #​1764, #​1703, #​1708, #​1709, #​1712, #​1724, #​1730, #​1747 - build and dependency updates (@​SimonCropp)
  • #​1723, #​1728, #​1731, #​1732, #​1734, #​1735, #​1733, #​1736, #​1739, #​1746, #​1745, #​1741, #​1742 - code clean-up and modernization (@​SimonCropp)
  • #​1750 - IAsyncDisposable support for Logger and sinks (@​nblumhardt)
  • #​1699 - fix some XDOC documentation (@​sungam3r)
  • #​1719 - remove redundant ! operator from null in conditions (@​sungam3r)
  • #​1725 - introduce file-scoped namespaces (@​sungam3r)
  • #​1700, #​1704, #​1707 - more nulllable annotation updates (@​nblumhardt)
  • #​1711 - fix support for ValueTuple (@​SimonCropp)

2.11.0

  • #​1503 - make some local functions static to avoid scope capture (@​SimonCropp)
  • #​1561 - add support for collections/string[] to key-value settings (@​stochmal)
  • #​1588, #​1591, #​1593, #​1594, #​1597 - nullable reference type annotations and language version updates (@​SimonCropp)
  • #​1595 - net5.0 target (@​nblumhardt)
  • #​1652 - fix capturing of anonymous types in .NET interactive (@​KZedan)
  • #​1641 - corrected documentation comments for MessageTemplateFormatMethod (@​JinsPeter)
  • #​1635 - fix destructuring of Memory<T>/ReadOnlyMemory<T> and non-reflection-compatible properties e.g. of type Span<T> (@​skomis-mm)
  • #​1625 - update issue template (@​augustoproiete)
  • #​1664 - update ILogger documentation (@​erichiller)

2.10.0

  • #​1370, #​1374 - improve test coverage (@​rafaelsc)
  • #​1371, #​1377, #​1429, #​1445 - documentation updates (@​perjahn, @​morgankenyon, @​rafaelsc, @​JakenVeina)
  • #​1378, #​1392 - build fixes (@​nblumhardt)
  • #​1477 - don't fail to log when ToString() throws an exception (@​rafaelsc)
  • #​1435 - netstandard2.1 support and default implementations for ILogger methods (@​skomis-mm)
  • #​1442 - MinimumLevel.Override() runtime optimizations (@​skomis-mm)
  • #​1463 - fix disposal of wrapped sinks through LoggerSinkConfiguration.Wrap()
  • #​1449 - allow exceptions to bubble up through wrapped aggregate sinks (@​augustoproiete)
  • #​1466 - internal wrapper sink refactoring (@​nblumhardt)
  • #​1427, #​1452, #​1467 - when ToString() on a logged object returns null, serialize as "" (@​rafaelsc, @​nblumhardt)
  • #​1472 - improve handling of minimum level overrides in sub-loggers (@​skomis-mm)

2.9.0

  • #​1296 - switch from TravisCI to AppVeyor for Linux builds (@​merbla)
  • #​1254, #​1255 - reduce allocations in hot path (@​Pliner)
  • #​1300 - link Pluralsight courses (@​dahlsailrunner)
  • #​1312 - code clean-up (@​sungam3r)
  • #​1314, #​1317 - code clean-up (@​SimonCropp)
  • #​1315 - reduce allocations in hot path (@​nblumhardt)
  • #​1266 - update package license declaration to the new format (@​tsimbalar)
  • #​1316 - support wrapped enrichers, conditional sinks, and conditional enrichers (@​nblumhardt)
  • #​1320 - publish snupkg symbol packages (@​teo-tsirpanis)
  • #​1325 - respect explicit format specifiers when using JSON formatting defaults (@​nblumhardt)
  • #​1330 - make the nullable format provider syntactically optional when constructing MessageTemplateTextFormatter (@​bender2k14)
  • #​1341 - remove redundant System.Collections.NonGeneric dependency from netstandard2.0 target (@​WeihanLi)
  • #​1348 - add INFLUENCES.md (@​nblumhardt)
  • #​1357 - fix API documentation for default destructuring depth (@​rob-earwaker)
  • #​1366 - fix message template parsing of custom format strings that contain + (@​martinh2011)

2.8.0

  • #​1179 - support for Destructure.AsScalar(type) in key-value settings (@​tsimbalar)
  • #​1174 - partial support for Destructure.Xxx() in key-value settings (@​tsimbalar)
  • #​1192 - support for Destructure.With(policy) in key-value settings (@​tsimbalar)
  • #​1189 - renew certificate to fix UWP integration tests (@​skomis-mm)
  • #​1197 - make it simple to compare Logger.Instance with Logger.None (@​ie-zero)
  • #​1198 - support *.With(...) and AuditTo.Sink(sink)/WriteTo.Sink(sink) in key-value settings (@​tsimbalar)
  • #​1220 - include repositoryUrl in the NuGet package (@​MaximRouiller)
  • #​1233 - fix padding of non-string values in output templates (@​nblumhardt)
  • #​1169 - update performance tests to netcoreapp2.0 (@​merbla)
  • #​1234 - add tests for custom IFormatProvider support (@​tsimbalar)
  • #​1236 - fix failure/exception thrown when calling ForContext() to destructure some generated proxy types (@​balayoglu)
  • #​1269 - add netstandard2.0 target to shrink dependency graph on compatible platforms (@​nblumhardt)

2.7.1

Version 2.7.0 was skipped due to a versioning mistake.

  • #​1075 - overload of LoggerSinkConfiguration.Wrap() accepting LoggingLevelSwitch
  • #​1083 - update package metadata, including https:// project and icon URLs
  • #​1091 - make {Properties:j} work consistently with the console sink
  • #​1110 - expose an efficient Logger.None
  • #​1113 - (tooling) improve tests for LogContext
  • #​1136 - (tooling) fix build.sh exit code
  • #​1141 - fix logging of byte[] smaller than 1 KB
  • #​1157 - (tooling) update .gitignore
  • #​1158 - (tooling) re-enable macOS builds
  • #​1163 - SourceLink v2 support
  • #​1165 - fix a number of issues with LoggerSinkConfiguration.Wrap() affecting WriteTo.Async()
  • #​1134 - (tooling) add README badges for downloads/stats
  • #​1166 - allow LoggerConfiguration to be garbage collected after logger is created
  • #​1160 - (tooling) update NuGet.org API key
  • (tooling) Update to use the latest .NET SDK

2.6.0

  • #​992 - fix LogContext remoting issue on .NET Framework 4.5
  • #​1007 - LogContext.Suspend() and LogContext.Reset() to pass or drop context from child tasks
  • #​1018 - include source in NUPKGs
  • #​1020 - support for LoggingLevelSwitch in key-value/<appSettings> settings
  • #​1033 - warn when MinimumLevel.Override() is used in a sub-logger
  • #​1034 - more efficient levelled ILogger.ForContext()/Log.ForContext()
  • #​1051 - handle duplicate keys in key-value/<appSettings> settings (last-in wins)
  • #​1064 - support static member references as key-value/<appSettings> values
  • #​1059 - support for abstract class parameters in settings
  • #​1068 - handle parsing of token width more robustly

Plus build/documentation items #​988, #​994, #​996, #​1019, #​842, #​1042, #​1050, #​1055, #​1063.

2.5.0

  • #​939, #​946, #​972 - RTM .NET Standard/Core tooling
  • #​955 - LoggerSinkConfiguration.Wrap()
  • #​944 - {Properties} in output templates
  • #​961 - fix parser exeception when property tokens with zero-length names are encountered
  • #​773 - LogContext.Clone() and LogContext.Push(ILogEventEnricher)
  • #​976 - support for logging C# 7 ValueTuple<> values
  • #​977 - output formatting performance improvements, {Message:l} (unquoted string) and {Message:j} (JSON structure) support in output templates
  • #​981 - reduced allocations required for structured data capturing

Plus multiple build/test/configuration improvements.

2.4.0

  • #​866 and #​877- additional event payload limiting controls
  • #​833 - improve performance of message template cache lookup
  • #​885 - fix JSON formatting of NaN and infinity values
  • #​888 - allow minimum level overrides to be specified by configuration providers like Serilog.Settings.AppSettings
  • #​903 - add further Log static methods to match ILogger methods
  • #​907 - properly dispose audit sinks
  • #​913 - include commit hash in AssemblyInformationalVersion
  • #​925 - allow configuration providers to specify filter directives

Plus build and test coverage work in #​821, #​824, #​896, etc.

2.3.0

  • #​870 - fix dispose for level-restricted sinks
  • #​852 - fix dictionary capturing when key/value are anonymous types
  • #​835 - avoid RemotingException via LogContext
  • #​855 - allow custom enum rendering (better ICustomFormatter support
  • #​841 - audit-to in key-value settings

2.2.1

  • #​835 (fix for .NET 4.6+ only)

2.2.0

  • #​826 - Audit-style logging
  • #​819 - Deprecate virtual extension points on JsonFormatter

2.1.0

#​782 - provide Destructure.ByTransformingWhere()
#​779 - capture additional parameters even when template is malformed
#​798 - fix overload selection in KeyValueSettings
#​815 - allow level to be lowered by overrides, in addition to being raised

Commits viewable in compare view.

Updated Serilog.Sinks.TextWriter from 2.0.0 to 3.0.0.

Release notes

Sourced from Serilog.Sinks.TextWriter's releases.

3.0.0

  • #​6 - update to new project format (@​danielchalmers)
  • #​7 - fix README.md header (@​danielchalmers)
  • Build on VS2022 (@​SimonCropp)
  • #​8 - breaking - update for Serilog 4 (@​Numpsy)

Breaking changes

TFMs prior to netstandard2.0 are no longer supported; use the 2.x series of packages on these platforms.

2.1.0

  • #​3 - custom ITextFormatter support (@​krajek)

Commits viewable in compare view.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps Serilog from 2.0.0 to 4.0.0
Bumps Serilog.Sinks.TextWriter from 2.0.0 to 3.0.0

---
updated-dependencies:
- dependency-name: Serilog
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: Serilog.Sinks.TextWriter
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Nov 12, 2025
@MjrTom MjrTom merged commit 9584ff4 into master Nov 12, 2025
1 check passed
@MjrTom MjrTom deleted the dependabot/nuget/src/Castle.Core.Tests/multi-7bc09f723c branch November 12, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants