AI OnAI Off
Adding the answer that we covered from Slack just for visibility.
Information logs are currently missing.Information Logs are MissingYes. Because Serilog’s minimum level is set toWarning, yourInformationlogs are being discarded before they ever reach Application Insights.
_logger.LogInformation("...");.MinimumLevel. Since it is set to Warning, Serilog immediately drops any Information level logs.Logging:ApplicationInsights:LogLevel:Default = Information setting is part of the native Microsoft logging configuration. Because Serilog is overriding the pipeline, this secondary filter is only evaluating the logs that Serilog actually passes to it.Information logs at Step 2, Application Insights never receives them to begin with.Information LogsInformation logs in Application Insights, you must change the Serilog configuration.Information, and your Logging:ApplicationInsights configuration is already at Information, you will start seeing those logs.Information will solve your immediate issue.Microsoft and System OverridesInformation, your logs will quickly become flooded with framework-level noise. This is where Overrides come in.Information), while keeping noisy framework telemetry quiet (Warning or Error).Microsoft.AspNetCore: Controls logs for every single HTTP request, routing decision, and middleware execution. Setting this to Warning prevents your App Insights from being flooded with standard 200 OK request logs.Microsoft / System: Controls internal .NET framework behavior, dependency injection lifetime events, and configuration loading.EPiServer: In an Optimizely DXP context, you can use overrides specifically for the CMS. For example, you might want your own code at Information, but keep EPiServer at Warning to avoid logging routine CMS background tasks, initialization steps, or content loading telemetry unless something goes wrong.Information logs are making it through before you deploy a configuration change, you can query your App Insights instance directly using Kusto Query Language (KQL) in the Azure Portal.0 : Verbose / Debug1: Information2: Warning3: Error4: CriticalSerilog:MinimumLevel:Default is required.Information logs before they are sent to Application Insights. However, when I run the following query in Application Insights:StopProfiler triggered.StopProfiler succeeded.LogInformation() entries are not.
Hi everyone,
I'm trying to better understand how logging configuration works in an Optimizely CMS 12 application using Serilog and Application Insights.
Below is a simplified version of our current configuration:
Based on this configuration, my understanding is:
WarningWarning,Error, andCriticallogs should be emitted by SerilogHowever, in several places in our application we are writing logs like:
These
Informationlogs do not appear in Application Insights.My questions are:
MinimumLevel.Defaultis set toWarning?Informationlogs in Application Insights, do I need to change:Serilog:MinimumLevel:DefaulttoInformationLogging:ApplicationInsights:LogLevel:DefaulttoInformationMy assumption is that these overrides suppress framework-generated logs while allowing application logs to follow the
Defaultlevel, but I'd like to confirm that understanding.Has anyone configured Optimizely CMS / Commerce applications with Serilog and Application Insights and can explain how these settings interact?
Additional Question
One more thing I'm trying to understand:
If
Informationlogs are already being generated by the application, is there a way to verify whether they exist in Application Insights even if they're not visible in the standard Logs/Failures views?For example:
Informationlogs are being ingested?traces,AppTraces, etc.) that I should query?Thanks in advance!