logging.debug() doesn't seem to make it to the logs
See original GitHub issueinfo()
, warning()
, and error()
all show up in Application Insights, but debug()
does not. Not sure if this is a worker issue or an Application Insights issue.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Python logging not outputting anything - Stack Overflow
debug ("Some string") , I get no output to the console, even though this page in the docs says that logging.debug should have...
Read more >Logging HOWTO — Python 3.11.1 documentation
logging.info() (or logging.debug() for very detailed output for diagnostic ... The INFO message doesn't appear because the default level is WARNING .
Read more >Debug Logs - Salesforce Help
Use debug logs to track events that occur in your org. Debug logs are generated when you have active user-based trace flags, when...
Read more >Python Logging: A Stroll Through the Source Code
Because the logger has level DEBUG , and the message carries a higher INFO level, it gets the go-ahead to move on. Internally,...
Read more >console.log() doesn't seem to work in Generic JavaScript View ...
Hi, i'm trying to debug codes, but i have a hard time finding errors because console.log doesn't create any output.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still an issue as far as I can see, I just lost quite a bit of time trying to track down why logging.debug() never makes it to the console using azure-functions-core-tools 3.0.2245. The snippet posted earlier does not help; core tools shows its own debug messages but the
logging.debug()
calls from the python worker continue to be swallowed.If I change this line to DEBUG, I see the output I expect in the console: https://github.com/Azure/azure-functions-python-worker/blob/dev/azure_functions_worker/dispatcher.py#L122
I tried to follow the suggestion to pass
--log-level=DEBUG
to the worker, but this log level is not included in the argparse setup: https://github.com/Azure/azure-functions-python-worker/blob/dev/azure_functions_worker/main.py#L19Furthermore,
azure-functions-core-tools
does not seem to provide a functioning mechanism to actually pass this argument, but my C# is a bit rusty, I have no development environment to use to debug that project on this work machine, and the way the code comes together to construct the config for Microsoft.Azure.WebJobs is a bit inscrutable and stringly-typed, so I couldn’t quite follow it without investing significantly more time.I did manage to discover that I can pass args through to the worker using
--language-worker
, but it’s prepend only and shoves the new arguments before theworker.py
file, so it’s close to useless without a shim script:So my shim script “works”, in the sense that it starts the worker with the extra arguments appended, but the
logging.debug()
calls are still swallowed unless I manually hackdispatcher.py:122
. This will do for me for now, but I can’t share this workflow with the other developers on my team, it’s unreasonable to expect them to be willing to do this.I don’t really know what to suggest here, but unless debug logging is explicitly not supported (if so, it should be documented prominently), it really seems to me like this issue should still be open.
@elprans, we should be fine to keep the system logs at the informational level. Those are already being sent to the table where keep our debugging information.
As for the original issue noted here, the desired behavior can be achieved with a combination of two steps:
debug
level (it is set to toinfo
by default).host.json
to logDebug
messages:With these changes, the logs should be visible on both the console as well as Application Insights. @asavaritayal, we can make note of this in our development wiki. Changing the logging settings currently would require re-deployment but we might be able to introduce some app settings to achieve this if that’s the route we want to go.