Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1.0 Release #1975

Merged
merged 15 commits into from Nov 9, 2023
Merged

3.1.0 Release #1975

merged 15 commits into from Nov 9, 2023

Conversation

nblumhardt
Copy link
Member

@nblumhardt nblumhardt commented Nov 3, 2023

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.

Breaking change

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, because the trace and span id values in any user-added properties are likely to be identical to the built-in ones.

nblumhardt and others added 15 commits June 22, 2023 07:56
* Modernize the README a little more

* Improve example

Co-authored-by: C. Augusto Proiete <augusto@proiete.com>

---------

Co-authored-by: C. Augusto Proiete <augusto@proiete.com>
… fix error when building without FEATURE_ITUPLE (#1960)
* Removed temporary array allocations for cases with the small number of log event properties

* Added test to ensure that null array does not break message template parameters binding

* Excluded ILogger.Write<T1, ...> methods from method body comparison test.
* By reference string comparison in template cache

* Removed by-value template cache
* Remove gitter from CONTRIBUTING.md
* Remove year from copyright
* Add Copyright prop for package
* CloseAndFlushAsync comment
* More shepherding to SO
@nblumhardt
Copy link
Member Author

Planning to merge this tomorrow (9th Nov.), so that any kinks in 3.1 can be ironed out before the .NET 8 *.Extensions packages go out next week.

@nblumhardt nblumhardt merged commit 765a046 into main Nov 9, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants