Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use app.name as app.logger name #3282

Merged
merged 1 commit into from
Jul 2, 2019
Merged

use app.name as app.logger name #3282

merged 1 commit into from
Jul 2, 2019

Conversation

davidism
Copy link
Member

@davidism davidism commented Jul 1, 2019

#2436 greatly simplified how logging is set up in Flask. Part of that removed the LOGGER_NAME config and hard-coded "flask.app". However, #2866 points out that due to this it is no longer possible to distinguish logs when dispatching multiple apps.

This partially reverts the logger name behavior change from 1.0. There is still no config, but the logger's name is now the same as app.name (basically the value passed to Flask(import_name)).

The information that's currently logged does make sense as coming from the user's project rather than Flask itself, although we may introduce the "flask.app" logger again in the future for logging things truly internal to Flask and not the user's app.

This may require projects to update their logging config to reference their app's name instead of "flask.app".

Closes #2866

@davidism davidism added this to the 1.1.0 milestone Jul 1, 2019
@davidism davidism merged commit 6665c91 into master Jul 2, 2019
@davidism davidism deleted the logger-name branch July 2, 2019 15:24
@davidism
Copy link
Member Author

davidism commented Jul 5, 2019

I need to log in to pocoo and disable the old site. The docs are at https://flask.palletsprojects.com/logging/.

@jab
Copy link
Member

jab commented Jul 5, 2019

Oh awesome! 🎉
I guess we need to get redirects set up too - let me know if I can help!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DispatcherMiddleware with different loggers per app in flask 1.0
2 participants