Edgewall Software

Changes between Version 19 and Version 20 of TracLogging


Ignore:
Timestamp:
Mar 25, 2015, 9:16:27 PM (9 years ago)
Author:
Ryan J Ollos
Comment:

Cosmetic changes.

Legend:

Unmodified
Added
Removed
Modified
  • TracLogging

    v19 v20  
    1 = Trac Logging =
     1= Trac Logging
    22[[TracGuideToc]]
    33[[TranslatedPages]]
     
    77Logging is configured in the `[logging]` section in [wiki:TracIni#logging-section trac.ini].
    88
    9 == Supported Logging Methods ==
     9== Supported Logging Methods
    1010
    1111The log method is set using the `log_type` option in [wiki:TracIni#logging-section trac.ini], which takes any of the following values:
     
    1717 '''eventlog''':: (Windows) Use the system's NT Event Log for Trac logging.
    1818
    19 == Log Levels ==
     19== Log Levels
    2020
    2121The verbosity level of logged messages can be set using the `log_level` option in [wiki:TracIni#logging-section trac.ini]. The log level defines the minimum level of urgency required for a message to be logged, and those levels are:
     
    2929Additionally, you can  enable logging of SQL statements at debug level. This is turned off by default, as it's very verbose. Set `[trac] debug_sql = yes` in TracIni to activate.
    3030
    31 == Log Format ==
     31== Log Format
    3232
    3333The output format for log entries can be specified through the `log_format` option in [wiki:TracIni#logging-section trac.ini]. The format is a string which can contain any of the [http://docs.python.org/library/logging.html#logrecord-attributes Python logging Formatter variables]. Additonally, the following Trac-specific variables can be used:
     
    3939
    4040The default format is:
    41 {{{
     41{{{#!ini
    4242log_format = Trac[$(module)s] $(levelname)s: $(message)s
    4343}}}
    4444
    4545In a multi-project environment where all logs are sent to the same place (e.g. `syslog`), it makes sense to add the project name. In this example we use `basename` since that can generally be used to identify a project:
    46 {{{
     46{{{#!ini
    4747log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s
    4848}}}