summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-25 15:33:57 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-04-26 12:10:53 +0200
commita21a5bc4ec77c3098985a6561d0f7a00bedb9250 (patch)
treed56796c80c3d98b95c502854dd1d7a4699490a89 /lib
parent0e6a3175162a1312c1035c4a2630a26f8c26d561 (diff)
downloadnextcloud-server-a21a5bc4ec77c3098985a6561d0f7a00bedb9250.tar.gz
nextcloud-server-a21a5bc4ec77c3098985a6561d0f7a00bedb9250.zip
improve Syslog a little
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Log/Syslog.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Log/Syslog.php b/lib/private/Log/Syslog.php
index 7bd7467f5c4..90a20026f0e 100644
--- a/lib/private/Log/Syslog.php
+++ b/lib/private/Log/Syslog.php
@@ -30,7 +30,7 @@ use OCP\IConfig;
use OCP\Log\IWriter;
class Syslog implements IWriter {
- static protected $levels = [
+ protected $levels = [
ILogger::DEBUG => LOG_DEBUG,
ILogger::INFO => LOG_INFO,
ILogger::WARN => LOG_WARNING,
@@ -40,7 +40,10 @@ class Syslog implements IWriter {
public function __construct(IConfig $config) {
openlog($config->getSystemValue('syslog_tag', 'ownCloud'), LOG_PID | LOG_CONS, LOG_USER);
- register_shutdown_function('closelog');
+ }
+
+ public function __destruct() {
+ closelog();
}
/**
@@ -50,7 +53,7 @@ class Syslog implements IWriter {
* @param int $level
*/
public function write(string $app, $message, int $level) {
- $syslog_level = self::$levels[$level];
+ $syslog_level = $this->levels[$level];
syslog($syslog_level, '{'.$app.'} '.$message);
}
}