Changes between Version 19 and Version 20 of TracLogging
- Timestamp:
- Mar 25, 2015, 9:16:27 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracLogging
v19 v20 1 = Trac Logging =1 = Trac Logging 2 2 [[TracGuideToc]] 3 3 [[TranslatedPages]] … … 7 7 Logging is configured in the `[logging]` section in [wiki:TracIni#logging-section trac.ini]. 8 8 9 == Supported Logging Methods ==9 == Supported Logging Methods 10 10 11 11 The log method is set using the `log_type` option in [wiki:TracIni#logging-section trac.ini], which takes any of the following values: … … 17 17 '''eventlog''':: (Windows) Use the system's NT Event Log for Trac logging. 18 18 19 == Log Levels ==19 == Log Levels 20 20 21 21 The 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: … … 29 29 Additionally, 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. 30 30 31 == Log Format ==31 == Log Format 32 32 33 33 The 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: … … 39 39 40 40 The default format is: 41 {{{ 41 {{{#!ini 42 42 log_format = Trac[$(module)s] $(levelname)s: $(message)s 43 43 }}} 44 44 45 45 In 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 47 47 log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s 48 48 }}}