summaryrefslogtreecommitdiffstats
path: root/lib/private/Log/Systemdlog.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-01-19 16:15:14 +0100
committerJoas Schilling <coding@schilljs.com>2022-01-19 16:15:14 +0100
commit4c41abd8169e78aa35bd6ea9bd9eda6d76817085 (patch)
tree44274debf7d77eeff07353dfa3a0e6b5e418f716 /lib/private/Log/Systemdlog.php
parenta7eefa293e4735ab9f249f9d12ced3e70823da35 (diff)
downloadnextcloud-server-4c41abd8169e78aa35bd6ea9bd9eda6d76817085.tar.gz
nextcloud-server-4c41abd8169e78aa35bd6ea9bd9eda6d76817085.zip
Allow to get custom loggers for syslog, errorlog and systemdlog too
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Log/Systemdlog.php')
-rw-r--r--lib/private/Log/Systemdlog.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Log/Systemdlog.php b/lib/private/Log/Systemdlog.php
index a01826c0b05..00f242e3718 100644
--- a/lib/private/Log/Systemdlog.php
+++ b/lib/private/Log/Systemdlog.php
@@ -56,14 +56,17 @@ class Systemdlog extends LogDetails implements IWriter {
protected $syslogId;
- public function __construct(SystemConfig $config) {
+ public function __construct(SystemConfig $config, ?string $tag = null) {
parent::__construct($config);
if (!function_exists('sd_journal_send')) {
throw new HintException(
'PHP extension php-systemd is not available.',
'Please install and enable PHP extension systemd if you wish to log to the Systemd journal.');
}
- $this->syslogId = $config->getValue('syslog_tag', 'Nextcloud');
+ if ($tag === null) {
+ $tag = $config->getValue('syslog_tag', 'Nextcloud');
+ }
+ $this->syslogId = $tag;
}
/**