use app.name as app.logger name

This commit is contained in:
David Lord 2019-07-01 14:56:18 -07:00
parent 465da9f610
commit df470aecb9
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
8 changed files with 40 additions and 25 deletions

View file

@ -1,12 +1,12 @@
.. _logging:
Logging
=======
Flask uses standard Python :mod:`logging`. All Flask-related messages are
logged under the ``'flask'`` logger namespace.
:meth:`Flask.logger <flask.Flask.logger>` returns the logger named
``'flask.app'``, and can be used to log messages for your application. ::
Flask uses standard Python :mod:`logging`. Messages about your Flask
application are logged with :meth:`app.logger <flask.Flask.logger>`,
which takes the same name as :attr:`app.name <flask.Flask.name>`. This
logger can also be used to log your own messages.
.. code-block:: python
@app.route('/login', methods=['POST'])
def login():