]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Implement per-connection logging token
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Feb 2021 16:53:18 +0000 (11:53 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Feb 2021 18:07:17 +0000 (13:07 -0500)
commit594f55d974150d6625004f72b3e284a4a1f796c1
tree2bd1dce616278b755a68c7e58ed7d1bac09f2f7b
parenta7eeac60cae28bb553327d317a88adb22c799ef3
Implement per-connection logging token

Added new execution option
:paramref:`_engine.Connection.execution_options.logging_token`. This option
will add an additional per-message token to log messages generated by the
:class:`_engine.Connection` as it executes statements. This token is not
part of the logger name itself (that part can be affected using the
existing :paramref:`_sa.create_engine.logging_name` parameter), so is
appropriate for ad-hoc connection use without the side effect of creating
many new loggers. The option can be set at the level of
:class:`_engine.Connection` or :class:`_engine.Engine`.

Fixes: #5911
Change-Id: Iec9c39b868b3578fcedc1c094dace5b6f64bacea
doc/build/changelog/unreleased_14/5911.rst [new file with mode: 0644]
doc/build/core/engines.rst
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/engine/cursor.py
test/engine/test_logging.py