Open tecxx opened 1 year ago
hello,
using an ExpressionTemplate to show only class name of SourceContext:
var logExpressionTemplate = new ExpressionTemplate(theme: Serilog.Templates.Themes.TemplateTheme.Literate, template: "[{@t:HH:mm:ss} {@l:u3} {Substring(SourceContext, LastIndexOf(SourceContext, '.') + 1)}] {@m}\n{@x}"); builder.Host.UseSerilog((hostingContext, loggerConfig) => loggerConfig.ReadFrom.Configuration(hostingContext.Configuration) .WriteTo.Console(logExpressionTemplate) .WriteTo.AzureApp(logExpressionTemplate)
while the console correctly outputs
i get this in azure log stream:
time, severity type and full classname are printed before the formatted text. how can i avoid that?
I'm experiencing the same issue. If you use: WriteTo.File(), the .txt logs in the deployed app will also have the double output.
WriteTo.File()
hello,
using an ExpressionTemplate to show only class name of SourceContext:
while the console correctly outputs![image](https://user-images.githubusercontent.com/4305825/209674739-bf3c361a-33e3-46f6-87ce-487efaed5941.png)
i get this in azure log stream:![image](https://user-images.githubusercontent.com/4305825/209674776-84d03ee2-3828-4e24-88ea-d78d5bbe023c.png)
time, severity type and full classname are printed before the formatted text. how can i avoid that?