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

When serilog column options properties are removed it does not fetch logs on UI #487 #90

Open
satsvelke opened this issue Sep 21, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request v3

Comments

@satsvelke
Copy link

When serilog column options properties are removed it does not fetch logs on UI #487

@mo-esmp
Copy link
Member

mo-esmp commented Sep 25, 2023

Serilog UI does not support optional column. Could you please share more info to produce the error.

@satsvelke
Copy link
Author

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

@mo-esmp mo-esmp added the enhancement New feature or request label Jan 26, 2024
@followynne followynne self-assigned this Apr 4, 2024
@followynne followynne added the v3 label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v3
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants