-
Notifications
You must be signed in to change notification settings - Fork 148
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
Additional Column (CorrelationId) Returning Null Value #527
Comments
Just to provide an update on this, the DataType for the CorrelationId column needs to be SqlDbType.UniqueIdentifier in order for it to be populated in the database table. This appears to be a breaking change between version 6.3.0 and 6.4.0. |
Hi @ryanrolfe! Thank you for telling us your finding. Can you please provide a small sample program which generates a log event that leads to a NULL value in the CorrelationId column? Thank you! |
Perhaps this problem is fixed with #515 which is fixed in the latest dev build on nuget.org. Can you please confirm this? |
I am not the OP, but have a similar problem with versions 6.4.0+ of the Serilog.Sinks.MSSqlServer package, and the newest dev version did not fix it for me. Would it be best to open a different issue and provide a sample program? |
@pkokay yes, please do that. I will close this issue. |
Bug Report / Support Request Template
If you are opening a feature request, you can ignore this template. Bug reports and requests for assistance usually require the same basic information described below. This will help us more quickly reproduce and investigate the problem you're reporting. (If you are using Serilog.Sinks.MSSqlServerCore, that package is deprecated, please switch to Serilog.Sinks.MSSqlServer before reporting an issue.)
[X] .NET 6
[ ] .NET Framework 4.8
[ ] .NET Framework 4.7
[ ] .NET Framework 4.6
OS:
Windows 10
serilogConfig
.WriteTo
.MSSqlServer(
connectionString,
sinkOptions: new MSSqlServerSinkOptions
{
TableName = "serilog",
SchemaName = "dbo",
AutoCreateSqlTable = true,
EagerlyEmitFirstEvent = Convert.ToBoolean(appenderConfig.Args["eagerlyEmitFirstEvent"]),
BatchPostingLimit = Convert.ToInt32(appenderConfig.Args["batchPostingLimit"])
},
columnOptions: columnOptions,
restrictedToMinimumLevel: level);
The text was updated successfully, but these errors were encountered: