Changes between Version 2 and Version 3 of TracLogging
- Timestamp:
- Sep 24, 2024, 8:55:54 AM (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracLogging
v2 v3 2 2 [[TracGuideToc]] 3 3 4 Trac supports logging of system messages using Python's [http ://docs.python.org/library/logging.html logging module].4 Trac supports logging of system messages using Python's [https://docs.python.org/2/library/logging.html logging module]. 5 5 6 6 Logging is configured in the [TracIni#logging-section "[logging]"] section of TracIni. … … 18 18 == Log Levels 19 19 20 The verbosity level of logged messages can be set using the [TracIni#logging-log_level-option "[logging] log_level"] option. The log level defines the minimum level of urgency required for a message to be logged , and those levels are:20 The verbosity level of logged messages can be set using the [TracIni#logging-log_level-option "[logging] log_level"] option. The log level defines the minimum level of urgency required for a message to be logged: 21 21 22 22 '''CRITICAL''':: Log only the most critical (typically fatal) errors. 23 '''ERROR''':: Log failures, bugs and errors. 23 '''ERROR''':: Log failures, bugs and errors. 24 24 '''WARN''':: Log warnings, non-interrupting events. 25 25 '''INFO''':: Diagnostic information, log information about all processing. 26 26 '''DEBUG''':: Trace messages, profiling, etc. 27 27 28 Additionally, you can 28 Additionally, you can enable logging of SQL statements at debug level. This is turned off by default, as it's very verbose. Set [TracIni#trac-debug_sql-option "[trac] debug_sql = yes"] to activate. 29 29 30 30 == Log Format … … 42 42 }}} 43 43 44 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` sincethat can generally be used to identify a project:44 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` as that can generally be used to identify a project: 45 45 {{{#!ini 46 46 log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s