azure-functions-core-tools
azure-functions-core-tools copied to clipboard
How to change log level when testing locally.
I'd like to be able to modify the log level when testing a function locally. I've tried setting the log level in local.settings.json but this had no impact:
"logging": { "logLevel": { "FunctionApp.FunctionName": "Debug" } }
Setting the default logLevel in host.json to debug resulted in a truck load more output from the runtime but did not show the LogDebug() output from my function. Adding the attribute "FunctionApp.FunctionName": "Debug" to the logLevel in host.json also made no difference.
Can you modify the log level when running locally? If so how?
Thanks in advance.
@wonboyn Does following the suggestions outlined in https://github.com/anthonychu/functions-log-suppression work for you?
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
Hi @michaelpeng36 - Thanks for the info. I tried the suggestions mentioned in the link, however it did not enable me to see debug log entries. For clarity I am creating a logger via ILoggerFactory.CreateLogger<T>() in an HTTP trigger function & then subsequently issuing logger.LogDebug() & these are the entries I am not able to see locally.
You don't even have to manually create a logger, it effects any of them injected via DI as well.