Development

Changeset 6972

You must first sign up to be able to contribute.

Changeset 6972

Show
Ignore:
Timestamp:
01/06/08 09:54:37 (11 months ago)
Author:
dwhittle
Message:

dwhittle: added back logging settings for task (sf_logging_history, sf_logging_period)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.1/data/config/settings.yml

    r6866 r6972  
    7070 
    7171    # Logging 
    72     logging_enabled:        on 
     72    logging_enabled:        on  # Enable error logging 
     73    logging_period:         31  # Days to keep logs before rotating 
     74    logging_history:        3   # How many log periods to archive 
    7375 
    7476    # I18n 
  • branches/dwhittle/1.1/data/skeleton/app/app/config/settings.yml

    r6866 r6972  
    9393 
    9494    # Logging 
    95     logging_enabled:        on 
     95    logging_enabled:        on  # Enable error logging 
     96    logging_period:         31  # Days to keep logs before rotating 
     97    logging_history:        3   # How many log periods to archive 
    9698 
    9799    # I18n 
  • branches/dwhittle/1.1/lib/task/log/sfLogRotateTask.class.php

    r6932 r6972  
    1919class sfLogRotateTask extends sfBaseTask 
    2020{ 
    21   /** the default period to rotate logs in days */ 
    22   const DEF_PERIOD = 7; 
    23  
    24   /** the default number of log historys to store, one history is created for every period */ 
    25   const DEF_HISTORY = 10; 
    2621 
    2722  /** 
     
    3631 
    3732    $this->addOptions(array( 
    38       new sfCommandOption('history', null, sfCommandOption::PARAMETER_REQUIRED, 'The maximum number of old log files to keep', 10), 
    39       new sfCommandOption('period', null, sfCommandOption::PARAMETER_REQUIRED, 'The period in days', 7), 
     33      new sfCommandOption('history', null, sfCommandOption::PARAMETER_REQUIRED, 'The maximum number of old log files to keep', sfConfig::get('sf_logging_history', 10)), 
     34      new sfCommandOption('period', null, sfCommandOption::PARAMETER_REQUIRED, 'The period in days', sfConfig::get('sf_logging_period', 7)), 
    4035    )); 
    4136 
     
    8580 
    8681    // set history and period values if not passed to default values 
    87     $period = isset($period) ? $period : self::DEF_PERIOD
    88     $history = isset($history) ? $history : self::DEF_HISTORY
     82    $period = isset($period) ? $period : sfConfig::get('sf_logging_period', 7)
     83    $history = isset($history) ? $history : sfConfig::get('sf_logging_history', 10)
    8984 
    9085    // get todays date