Make logging facility configurable

This commit is contained in:
Zach Copley 2009-07-02 16:06:13 -07:00
parent 608a7ba77c
commit d80c553e5f
3 changed files with 7 additions and 2 deletions

View File

@ -36,6 +36,9 @@ $config['site']['path'] = 'laconica';
// If you want logging sent to a file instead of syslog // If you want logging sent to a file instead of syslog
// $config['site']['logfile'] = '/tmp/laconica.log'; // $config['site']['logfile'] = '/tmp/laconica.log';
// Change the syslog facility that Laconica logs to
// $config['syslog']['facility'] = LOG_LOCAL7;
// Enables extra log information, for example full details of PEAR DB errors // Enables extra log information, for example full details of PEAR DB errors
// $config['site']['logdebug'] = true; // $config['site']['logdebug'] = true;

View File

@ -124,7 +124,8 @@ $config =
'dupelimit' => 60), # default for same person saying the same thing 'dupelimit' => 60), # default for same person saying the same thing
'syslog' => 'syslog' =>
array('appname' => 'laconica', # for syslog array('appname' => 'laconica', # for syslog
'priority' => 'debug'), # XXX: currently ignored 'priority' => 'debug', # XXX: currently ignored
'facility' => LOG_USER),
'queue' => 'queue' =>
array('enabled' => false, array('enabled' => false,
'subsystem' => 'db', # default to database, or 'stomp' 'subsystem' => 'db', # default to database, or 'stomp'

View File

@ -1098,7 +1098,8 @@ function common_ensure_syslog()
{ {
static $initialized = false; static $initialized = false;
if (!$initialized) { if (!$initialized) {
openlog(common_config('syslog', 'appname'), 0, LOG_USER); openlog(common_config('syslog', 'appname'), 0,
common_config('syslog', 'facility'));
$initialized = true; $initialized = true;
} }
} }