forked from orbit-oss/flask
use app.name as app.logger name
This commit is contained in:
parent
465da9f610
commit
df470aecb9
8 changed files with 40 additions and 25 deletions
|
|
@ -382,7 +382,7 @@ The following configuration values are used internally by Flask:
|
|||
|
||||
.. versionchanged:: 1.0
|
||||
``LOGGER_NAME`` and ``LOGGER_HANDLER_POLICY`` were removed. See
|
||||
:ref:`logging` for information about configuration.
|
||||
:doc:`/logging` for information about configuration.
|
||||
|
||||
Added :data:`ENV` to reflect the :envvar:`FLASK_ENV` environment
|
||||
variable.
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ errors, use ``getattr`` to get access it for compatibility.
|
|||
Logging
|
||||
-------
|
||||
|
||||
See :ref:`logging` for information on how to log exceptions, such as by
|
||||
See :doc:`/logging` for information on how to log exceptions, such as by
|
||||
emailing them to admins.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue