Ignore:
Timestamp:
Apr 24, 2015, 4:00:50 PM (10 years ago)
Author:
mistic100
Message:

feature 3221 Add Logger class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r29904 r31102  
    105105include(PHPWG_ROOT_PATH . 'include/constants.php');
    106106include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
     107include(PHPWG_ROOT_PATH . 'include/template.class.php');
     108include(PHPWG_ROOT_PATH . 'include/cache.class.php');
     109include(PHPWG_ROOT_PATH . 'include/Logger.class.php');
    107110
    108111$persistent_cache = new PersistentFileCache();
     
    122125
    123126load_conf_from_db();
     127
     128$logger = new Logger(array(
     129  'directory' => PHPWG_ROOT_PATH . $conf['data_location'] . $conf['log_dir'],
     130  'severity' => $conf['log_level'],
     131  // we use an hashed filename to prevent direct file access, and we salt with
     132  // the db_password instead of secret_key because the log must be usable in i.php
     133  // (secret_key is in the database)
     134  'filename' => 'log_' . date('Y-m-d') . '_' . sha1(date('Y-m-d') . $conf['db_password']) . '.txt',
     135  'globPattern' => 'log_*.txt',
     136  'archiveDays' => $conf['log_archive_days'],
     137  ));
    124138
    125139if (!$conf['check_upgrade_feed'])
Note: See TracChangeset for help on using the changeset viewer.