Mercurial > p > roundup > code
diff doc/admin_guide.txt @ 8443:39a6825d10ca
feat: allow admin to set logging format from config.ini
This is prep work for adding a per thread logging variable that can be
used to tie all logs for a single request together.
This uses the same default logging format as before, just moves it to
config.ini.
Also because of configparser, the logging format has to have doubled %
signs. So use:
%%(asctime)s
not '%(asctime)s' as configparser tries to interpolate that string and
asctime is not defined in the configparser's scope. Using %%(asctime)s
is not interpolated by configparser and is passed into Roundup.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 01 Sep 2025 21:54:48 -0400 |
| parents | 0bb29d0509c9 |
| children | 14c7c07b32d8 |
line wrap: on
line diff
--- a/doc/admin_guide.txt Mon Sep 01 20:35:54 2025 -0400 +++ b/doc/admin_guide.txt Mon Sep 01 21:54:48 2025 -0400 @@ -63,6 +63,8 @@ - tracker configuration file lets you disable other loggers (e.g. when running under a wsgi framework) with ``logging`` -> ``disable_loggers``. + - tracker configuration file can set the log format using + ``logging`` -> ``format``. See :ref:`logFormat` for more info. - ``roundup-server`` specifies the location of a log file on the command line - ``roundup-server`` enable using the standard python logger with @@ -83,10 +85,26 @@ In both cases, if no logfile is specified then logging will simply be sent to sys.stderr with only logging of ERROR messages. +.. _logFormat: + +Defining the Log Format +----------------------- + +Starting with Roundup 2.6 you can specify the logging format. In the +``logging`` -> ``format`` setting of config.ini you can use any of the +`standard logging LogRecord attributes +<https://docs.python.org/3/library/logging.html#logrecord-attributes>`_. +However you must double any ``%`` format markers. The default value +is:: + + %%(asctime)s %%(levelname)s %%(message)s + Standard Logging Setup ---------------------- -You can specify your log configs in one of two formats: +If the settings in config.ini are not sufficient for your logging +requirements, you can specify a full logging configuration in one of +two formats: * `fileConfig format <https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig>`_
