question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Logging level debug does not work in local or portal logs

See original GitHub issue

Investigative information

Please provide the following:

In any python function, log level debug does not display in both local and portal logs.

Repro steps

Provide the steps required to reproduce the problem:

Expected behavior

Provide a description of the expected behavior.

Actual behavior

Provide a description of the actual behavior observed.

Known workarounds

Provide a description of any known workarounds.

Contents of the requirements.txt file:

Provide the requirements.txt file to help us find out module related issues.

Related information

Provide any related information
  • Links to source
  • Bindings used

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vrdmrcommented, Sep 3, 2020

@Hazhzeng

When the worker process is created, the host is not passing --log-level flag into the argument, thus the Python worker will only emit the INFO log into console. https://github.com/Azure/azure-functions-python-worker/blob/dev/azure_functions_worker/main.py#L21

How do we configure debug logging for workers logs from the host side? Is there an app setting that the host can pass in?

1reaction
Hazhzengcommented, Sep 3, 2020

Thanks @pragnagopa, @vrdmr and @stefanushinardi for the offline sync up. We determine that there’re two places blocking the logging from emitting debug level logs:

  1. When the worker process is created, the host is not passing --log-level flag into the argument, thus the Python worker will only emit the INFO log into console. https://github.com/Azure/azure-functions-python-worker/blob/dev/azure_functions_worker/main.py#L21
  2. After the worker establishes GRPC channel to the host, the root logger will stop using console log and switch to GRPC log which is pinned to INFO https://github.com/Azure/azure-functions-python-worker/blob/dev/azure_functions_worker/dispatcher.py#L125

Since the GRPC logging handler is attached onto the root logger, currently we have a concern on the performance when dropping the INFO level constrain, since some third-party libraries are using DEBUG level logs (e.g. azure-storage-blob https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py#L201-L203).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot and Enable Debugs on ISE - Cisco
This document describes how to troubleshoot and debugs to enable when a specific issue occurs on Identity Service Engine (ISE).
Read more >
When to use the different log levels - Stack Overflow
I generally subscribe to the following convention: Trace - Only when I would be "tracing" the code and trying to find one part...
Read more >
Configuring the BIG-IP APM Logging Levels (12.x and newer)
Impact of procedure: Enabling APM debug logging may cause excessive logging in a system with a large number of user logins. You should...
Read more >
Logging in .NET Core and ASP.NET Core | Microsoft Learn
In the preceding JSON, the Debug provider's default log level is set to ... The : separator doesn't work with environment variable ...
Read more >
Production Debugging: Everything You Need to Know - Rookout
Each log line is another code statement that needs to be run. ... is debugging an application that does not run in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found