summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2021-07-02 14:36:53 +0100
committerGitHub <noreply@github.com>2021-07-02 15:36:53 +0200
commitfa35c8bdbc6aca65d94d6280fa463d5bc7baa5c0 (patch)
treefd32615a8397e8c5068eb45a0c7e43ed1eb44795 /docs/ref
parent313c3d1aa14d80922003f841c257ec4e153f8653 (diff)
Fixed #30934 -- Included database alias in django.db.backends log messages.
This is useful when working with database routing as you want to know where each query is being executed. Co-authored-by: David Winterbottom <david.winterbottom@gmail.com>
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/logging.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/logging.txt b/docs/ref/logging.txt
index e60583c41c..8c682dfceb 100644
--- a/docs/ref/logging.txt
+++ b/docs/ref/logging.txt
@@ -178,6 +178,7 @@ Messages to this logger have the following extra context:
* ``duration``: The time taken to execute the SQL statement.
* ``sql``: The SQL statement that was executed.
* ``params``: The parameters that were used in the SQL call.
+* ``alias``: The alias of the database used in the SQL call.
For performance reasons, SQL logging is only enabled when
``settings.DEBUG`` is set to ``True``, regardless of the logging
@@ -188,6 +189,10 @@ This logging does not include framework-level initialization (e.g.
``COMMIT``, and ``ROLLBACK``). Turn on query logging in your database if you
wish to view all database queries.
+.. versionchanged:: 4.0
+
+ The database ``alias`` was added to log messages.
+
.. _django-security-logger:
``django.security.*``