serilog-mssql / serilog-sinks-mssqlserver

A Serilog sink that writes events to Microsoft SQL Server and Azure SQL
Apache License 2.0
278 stars 148 forks source link

Opt-in to TraceId enrichment for ASP.NET Core 5.0 logs - support in Serilog.Sinks.MSSqlServer #488

Closed ccvik19 closed 10 months ago

ccvik19 commented 11 months ago

Please add TraceId support into the SQL Server sink.

This is related to the following issue: https://github.com/serilog/serilog-aspnetcore/issues/207

The TraceId was changed in .Net Core 5 and the TraceId is no longer included in the logs. Issue #207 was fixed, but each sink must implement the change. It looks like several sinks have been updated already, but Serilog.Sinks.MSSqlServer still doesn't have support. This is important to us, since we user the TraceId extensively.

List the names and versions of all Serilog packages used in the project:

  • Serilog:
  • Serilog.Sinks.MSSqlServer
  • Serilog.Enrichers.AspnetcoreHttpcontext
  • Serilog.Exceptions

Target framework and operating system: [ ] .NET 6

Thanks you!

ckadluba commented 11 months ago

Hi @ccvik19!

Thanks for pointing us at this recent development in serilog core. I will definitly have a look at this soon.

Cheers, Christian ✌️

ckadluba commented 10 months ago

There is now a preview version 6.5.0-dev-00060 of the MSSQL sink up on nuget.org (https://www.nuget.org/packages/Serilog.Sinks.MSSqlServer/6.5.0-dev-00060) containing support for TraceId and SpanId.

We would appreciate everyone who tries it out and gives us some feedback.