Closed richard0326 closed 1 year ago
Hello I would like to customize structedLogging Is it possible??
Or can I make custom log processor?? your example doesn't work MessageTest.cs It output nothing...
And I would like to use Payload in custom log processor.
this code is using Prefix, Suffix
builder.AddZLoggerConsole(options => { options.PrefixFormatter = (writer, info) => { var strList = new List<string>() { $"\"CategoryName\":\"{info.CategoryName}\"", $"\"LogLevel\":\"{info.LogLevel}\"", $"\"Timestamp\":\"{info.Timestamp.DateTime.ToLocalTime()}\"", $"\"Exception\":\"{info.Exception}\"", }; var outStr = String.Join(", ", strList); ZString.Utf8Format(writer, "{0}, \"Message\":\"", "{" + outStr); }; }
this code is using structedLogging I would like to erase EventID or some values I don't use.
builder.AddZLoggerConsole(options => { options.PrefixFormatter = (writer, info) => { options.EnableStructuredLogging = true; options.StructuredLoggingFormatter = (writer, info) => { //writer.WriteString(applicationKey, applicationValue); info.WriteToJsonWriter(writer); }; options.JsonSerializerOptions = new JsonSerializerOptions { WriteIndented = false, IgnoreNullValues = true, Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) }; }; }
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Hello I would like to customize structedLogging Is it possible??
Or can I make custom log processor?? your example doesn't work MessageTest.cs It output nothing...
And I would like to use Payload in custom log processor.
this code is using Prefix, Suffix
this code is using structedLogging I would like to erase EventID or some values I don't use.