diff options
Diffstat (limited to 'lib/private/Log/Syslog.php')
-rw-r--r-- | lib/private/Log/Syslog.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Log/Syslog.php b/lib/private/Log/Syslog.php index b652eb4343d..b8fba34d62b 100644 --- a/lib/private/Log/Syslog.php +++ b/lib/private/Log/Syslog.php @@ -25,11 +25,11 @@ namespace OC\Log; +use OC\SystemConfig; use OCP\ILogger; -use OCP\IConfig; use OCP\Log\IWriter; -class Syslog implements IWriter { +class Syslog extends LogDetails implements IWriter { protected $levels = [ ILogger::DEBUG => LOG_DEBUG, ILogger::INFO => LOG_INFO, @@ -38,7 +38,8 @@ class Syslog implements IWriter { ILogger::FATAL => LOG_CRIT, ]; - public function __construct(IConfig $config) { + public function __construct(SystemConfig $config) { + parent::__construct($config); openlog($config->getSystemValue('syslog_tag', 'Nextcloud'), LOG_PID | LOG_CONS, LOG_USER); } @@ -54,6 +55,6 @@ class Syslog implements IWriter { */ public function write(string $app, $message, int $level) { $syslog_level = $this->levels[$level]; - syslog($syslog_level, '{'.$app.'} '.$message); + syslog($syslog_level, $this->logDetailsAsJSON($app, $message, $level)); } } |