3

I'm developing azure functions using visual studio and the v3 runtime.

I'm trying to reduce the volume of trace messages going to application insights but I would still like to see them when running the function locally in visual studio.

From reading bits of documentation I think I need to set up log filtering at "Information" for the application insights provider and "Trace" for the console provider.

Is this possible? I've been trying out changing the hosts.json file from settings that I've found online but the filters only seem to apply to the log category, not the provider.

Is this possible?

0

1 Answer 1

3

You can override settings in your hosts.json file by creating an application setting. As per the docs, you just need a setting with a name like AzureFunctionsJobHost__path__to__setting. For example:

{
    "IsEncrypted": false,
    "Values": {
        /* snip */
        "AzureFunctionsJobHost__logging__logLevel__default": "Trace"
    }
}

And in your function app, just add AzureFunctionsJobHost__logging__logLevel__default with a value of Information.

2
  • 1
    Thanks, that's just what I needed. Don't know why you got a downvote!
    – Twisted
    Oct 7, 2020 at 11:13
  • Who knows! Glad it helped you though.
    – DavidG
    Oct 7, 2020 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.