I have a ASP.NET Core 2.x Azure web app. I'm using Serilog to handle the logging. I would like my log files to end up in Azure Blob Storage but have been unable to get it configured properly.
As per the instructions at this link, I have enabled "Blob Application Logging" with minimum level "Information".
In my web app's Startup.cs file, I have configured Serilog as follows:
Serilog.Log = new LoggerConfiguration()
.WriteTo.Trace(Serilog.Events.LogEventLevel.Information)
.WriteTo.Console(Serilog.Events.LogEventLevel.Information)
.WriteTo.RollingFile(@"../logs/logfile-{Date}.txt", outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {Level}:{EventId} [{SourceContext}] {Message}{NewLine}{Exception}")
.CreateLogger();
With this configuration, the local file system rolling file sink seems to work just fine, but I'm not getting any logs from Serilog in the blob storage files.
I do get SOME logs in the blob storage logs, but none of them are from Serilog, they all seem to come from the .NET framework itself.
Am I missing some kind of link that would allow me to pipe Serilog output to the blob storage logs along with the Microsoft logs?