Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 1 and Version 2 of LoggingConfiguration


Ignore:
Timestamp:
05/16/06 17:18:44 (13 years ago)
Author:
jorge.vargas
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LoggingConfiguration

    v1 v2  
    1 Starting from release 0.9a5, TurboGears supports configuring logging directly via project's configuration files.  
    2  
    3 Configuration format is mostly opaque to TurboGears - data is justed passed down to [http://docs.python.org/lib/module-logging.html logging module]. Since configuring logging is sometimes tricky (especially for novices) here are a few recipes. 
    4  
    5 == Sample !#1 == 
    6  
    7 Say you have a project named Foobar which logs under "foobar.*" namespace. You want to: 
    8  
    9   * separate log for all project messages, including DEBUG messages 
    10   * separate log for all errors messages (including, but not limited to your project) 
    11   * separate log for all non-debug messages (including, but not limited to your project) 
    12  
    13 Put the following into your prod.cfg: 
    14  
    15 {{{ 
    16 [logging] 
    17  
    18 [[handlers]] 
    19 [[[debug_out]]] 
    20 class='FileHandler' 
    21 formatter='full_content' 
    22 args="('foobar-debug.log', 'a+')" 
    23  
    24 [[[error_out]]] 
    25 level='WARN' 
    26 class='FileHandler' 
    27 formatter='full_content' 
    28 args="('foobar-errors.log', 'a+')" 
    29  
    30 [[[access_out]]] 
    31 level='INFO' 
    32 class='FileHandler' 
    33 formatter='full_content' 
    34 args="('foobar-info.log', 'a+')" 
    35  
    36 [[loggers]] 
    37 [[[your_project]]] 
    38 level='DEBUG' 
    39 qualname='foobar' 
    40 handlers=['debug_out'] 
    41  
    42 [[[access]]] 
    43 level='INFO' 
    44 handlers=['access_out', 'error_out'] 
    45 }}} 
    46  
    47 You may want to tweak filenames to be absolute. 
     1moved to LoggingConfigurationExamples