From d80c553e5f6e523de380d7c9dc0bbdb9d06cb45e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 2 Jul 2009 16:06:13 -0700 Subject: [PATCH] Make logging facility configurable --- config.php.sample | 3 +++ lib/common.php | 3 ++- lib/util.php | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config.php.sample b/config.php.sample index a23b41b319..4f8f715beb 100644 --- a/config.php.sample +++ b/config.php.sample @@ -36,6 +36,9 @@ $config['site']['path'] = 'laconica'; // If you want logging sent to a file instead of syslog // $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 // $config['site']['logdebug'] = true; diff --git a/lib/common.php b/lib/common.php index 5d451463b9..14be747bc7 100644 --- a/lib/common.php +++ b/lib/common.php @@ -124,7 +124,8 @@ $config = 'dupelimit' => 60), # default for same person saying the same thing 'syslog' => array('appname' => 'laconica', # for syslog - 'priority' => 'debug'), # XXX: currently ignored + 'priority' => 'debug', # XXX: currently ignored + 'facility' => LOG_USER), 'queue' => array('enabled' => false, 'subsystem' => 'db', # default to database, or 'stomp' diff --git a/lib/util.php b/lib/util.php index 461ca15c15..d4d79afb30 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1098,7 +1098,8 @@ function common_ensure_syslog() { static $initialized = false; if (!$initialized) { - openlog(common_config('syslog', 'appname'), 0, LOG_USER); + openlog(common_config('syslog', 'appname'), 0, + common_config('syslog', 'facility')); $initialized = true; } }