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
to Outputting JSON with the MSSqlServer Serilog sink, I have added below configurations
`
var colOpts = new ColumnOptions();
colOpts.Store.Add(StandardColumn.LogEvent);
colOpts.Store.Remove(StandardColumn.Properties);
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.Logger(x => x.Filter.ByIncludingOnly(k => k.Level == LogEventLevel.Error || k.Level == LogEventLevel.Fatal).WriteTo.MSSqlServer(connectionString: errorLogsConnectionString,
sinkOptions: new MSSqlServerSinkOptions { TableName = "ErrorLogs", AutoCreateSqlTable = true }, columnOptions: colOpts))
.WriteTo.Logger(c => c.Filter.ByIncludingOnly(e => e.Level != LogEventLevel.Error)
.WriteTo.File(
new JsonFormatter()
, serilogLogPath.Value
, rollingInterval: RollingInterval.Day
, rollOnFileSizeLimit: true))
.CreateLogger();`
the properties column stores in XML format , and LogEvent columns stores in json format, so when I do this , the MSSqlServerSinkOptions create a column LogEvent instead of Properties , but SerilogUi does not work in this scenario as there is no Properties column because of below line it might throwing error
queryBuilder.Append("SELECT [Id], [Message], [Level], [TimeStamp], [Exception], [Properties] FROM [");
Can you add support for json output as well as additional columns
When serilog column options properties are removed it does not fetch logs on UI #487
The text was updated successfully, but these errors were encountered: