0

There's a question/answer explaining how to get rid of specific exceptions:

Preventing Specific Exceptions from being logged to app insights

I don't need anything as complex as this, as I want to get rid of all exceptions of type info (LogLevel=info) for namespace "Azure.Messaging.ServiceBus". Is this possible? I tried the following:

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true,
                "excludedTypes": "Request"
            },
            "logLevel": {
                "default": "Information",
                "Azure.Messaging.ServiceBus": "Warning"
            }
        },
        "logLevel": {
            "default": "Information",
            "Azure.Messaging.ServiceBus": "Warning",
        }
    }
}

host.json

Unfortunately it doesn't work, as "Exceptions are logged at the Error level.": Azure Functions Monitoring Log Level Categories

I was now looking to the "isExceptionSnappointsEnabled" flag, which might be what I want, but I'm not sure. Can you help me?

Luis Gouveia
  • 8,334
  • 9
  • 46
  • 68

1 Answers1

0

The value of the log level configures the logger to send logs of that severity or higher. You can refer to this table for the levels available.

In your case, you could set the value to Warning or higher level.

PramodValavala
  • 6,026
  • 1
  • 11
  • 30
  • That's what I did (just check my host.json). Still, no luck. – Luis Gouveia Jan 21 '23 at 00:26
  • 1
    Your `default` is set to `Information`. Have you tried changing that to `Warning` or higher? – PramodValavala Jan 23 '23 at 18:37
  • The default is 'Information' because I want the 'Warning' (or higher) to be effective exclusively on the namespace "Azure.Messaging.ServiceBus". – Luis Gouveia Jan 23 '23 at 18:49
  • 1
    You mention you want to get rid of all logs of type information. Is that not the case though? Sorry if I'm misunderstanding something obvious here. Could you elaborate and share some logs highlighting what you want to not have? – PramodValavala Jan 23 '23 at 18:57
  • PramodValala-MSFT, thumbs up for your comments, I updated my question as I shouldn't have said that – Luis Gouveia Jan 24 '23 at 08:39