You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across unexpected behavior when attaching Dash instances to a Flask application. The logger attached to the Dash app causes log messages sent to my application's logger (e.g. current_app.logger.info('foo')) to be output N+1 times (N=number of Dash applications attached to Flask app).
I was able to work around this by removing the handler added by Dash:
my_dash = dash.Dash(__name__,
server=app,
url_base_pathname='/my_dash/',
assets_folder="../dashboards/foo/bar/assets"
)
if (my_dash.logger.hasHandlers()):
my_dash.logger.handlers.clear()
Ideally, I'd either be able to opt out of having Dash attach the handler and/or provide a custom logger/handler via a Dash constructor kwarg. I'd be happy to take a pass at submitting a PR if this is something the maintainers would consider.
The text was updated successfully, but these errors were encountered:
ethagnawl
changed the title
Allow users to override the default logger [Feature Request]
Allow users to override the default logger and handler [Feature Request]
Jan 28, 2020
I came across unexpected behavior when attaching Dash instances to a Flask application. The logger attached to the Dash app causes log messages sent to my application's logger (e.g.
current_app.logger.info('foo')
) to be output N+1 times (N=number of Dash applications attached to Flask app).I was able to work around this by removing the handler added by Dash:
Ideally, I'd either be able to opt out of having Dash attach the handler and/or provide a custom logger/handler via a Dash constructor kwarg. I'd be happy to take a pass at submitting a PR if this is something the maintainers would consider.
The text was updated successfully, but these errors were encountered: