I have a .NET 6 project writing application logs to Console using Serilog. The app is hosted on a Windows App Service.
Setup like this:
builder.Host.UseSerilog((ctx, lc) => lc
.Enrich.FromLogC1ontext()
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Literate);
I have setup a Diagnostic Setting on the App Service to send the logs from Console Output to the Event Hub, but no console logs are sent to Event Hub.
I have also tried enabling HttpLogs, which work fine. So the trigger is working, but how do I get the stdout/Console logs to work?
CodePudding user response: