Skip to content

Set app log level to logging.DEBUG instead of logging.INFO #532

Open
@claresloggett

Description

@claresloggett

Recently I tried using logging to record debugging information in my callbacks via app.logger (see discussion at https://community.plot.ly/t/logging-debug-messages-suppressed-in-callbacks) and found that some debug messages were being ignored, apparently only when they were logged from callbacks.

It turned out that with the default behaviour (i.e. silence_routes_logging=True), debug messages don't get logged after the server is started as Dash sets self.logger.setLevel(logging.INFO) when app.run_server() is called (see

dash/dash/dash.py

Line 1162 in aac493c

self.logger.setLevel(logging.INFO)
). It's easy to work around, but @ned2 suggested that it might be more sensible for Dash to set its master log level to logging.DEBUG anyway. As an end-user it was not obvious to me why my debug messages were being logged at first and then weren't.

If this would be a sensible change, I'm happy to make a mini-PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclecscustomer successfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions