I have a pretty simple MVC Core 2.2 application that is utilizing Serilog and serilog-sinks-azure-analytics (https://github.com/saleem-mirza/serilog-sinks-azure-analytics) to pipe application logs to an Azure log analytics workspace. The implementation looks like this in Program.cs
public static void Main(string[] args)
{
var workspaceId = Configuration["AzureLogging:workspaceId"];
var authenticationId = Configuration["AzureLogging:authenticationId"];
var logName = Configuration["AzureLogging:logName"];
//Configure Serilog to add Azure Logging
Log.Logger = new LoggerConfiguration()
.WriteTo.AzureAnalytics(
workspaceId: workspaceId,
authenticationId: authenticationId,
logName: logName
)
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("System", LogEventLevel.Warning)
.CreateLogger();
CreateWebHostBuilder(args).Build().Run();
}
It collected logs for all of day then apparently stopped as when i query the last few hours via the log analytics workspace it returns nothing. If I run a query for the last 7 days I get a count of 350 records which is interesting.
The documentation for the sink project states that the logBufferSize is 25,000 entries by default so it doesn't seem like I am hitting that.
I would appreciate any suggestions on how to diagnose where my logs are or why it might be failing.
Thanks in advance.