Why is the App Insight LogLevel in appsettings being ignored?

You’ve got the LogLevel property for ApplicationInsights in the wrong place. Here’s what it should look like:

"Logging": {
    "LogLevel": {
        "Default": "Information",
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
    },
    "ApplicationInsights": {
        "LogLevel": {
            "Default": "Information",
            "Microsoft": "Warning",
            "Microsoft.Hosting.Lifetime": "Information"
        }
    }
},
"ApplicationInsights": {
    "InstrumentationKey": "12345678-1234-5678-1234-1234567890ab"    
}

The log-level configuration lives under the Logging parent, but the InstrumentationKey lives outside of that hierarchy.

See Configure logging in the official ASP.NET Core docs for more about provider-specific configuration.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)