You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #117 added support for binary and varbinary SQL column data types, but it doesn't work -- and can't work.
If you try to actually create a SQL binary column and populate it, the sink throws an exception because Serilog's internal property-handling has already converted the byte array property data to a clipped string stored as a ScalarValue object. The sink never sees the byte array and the string data is a mismatch for the column type.
The sink couldn't support this type of data unless Serilog's own internal property-handling changed, which seems unlikely...
The code to reproduce this is simple enough:
staticvoidMain(string[]args){varappConfig=newConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appconfig.json").Build();Log.Logger=newLoggerConfiguration().ReadFrom.Configuration(appConfig).CreateLogger();varsmaller=newbyte[60];varlarger=newbyte[1024];Randomrandom=newRandom();random.NextBytes(smaller);random.NextBytes(larger);SelfLog.Enable(Console.Out);Log.Information("smaller {ba_binary}",smaller);Log.Information("larger {ba_binary)",larger);Log.Information("var smaller {ba_varbinary}",smaller);Log.Information("var larger {ba_varbinary)",larger);Log.CloseAndFlush();Console.WriteLine("Press any key...");Console.ReadKey();}
PR #117 added support for
binary
andvarbinary
SQL column data types, but it doesn't work -- and can't work.If you try to actually create a SQL
binary
column and populate it, the sink throws an exception because Serilog's internal property-handling has already converted the byte array property data to a clipped string stored as aScalarValue
object. The sink never sees the byte array and the string data is a mismatch for the column type.The sink couldn't support this type of data unless Serilog's own internal property-handling changed, which seems unlikely...
The code to reproduce this is simple enough:
The text was updated successfully, but these errors were encountered: