summaryrefslogtreecommitdiffstats
path: root/lib/private/Log/Errorlog.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/Errorlog.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/Errorlog.php')
-rw-r--r--lib/private/Log/Errorlog.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Log/Errorlog.php b/lib/private/Log/Errorlog.php
index ebcb73be4ce..d27759d7050 100644
--- a/lib/private/Log/Errorlog.php
+++ b/lib/private/Log/Errorlog.php
@@ -29,6 +29,13 @@ use OCP\Log\IWriter;
class Errorlog implements IWriter {
+ /** @var string */
+ protected $tag;
+
+ public function __construct(string $tag = 'owncloud') {
+ $this->tag = $tag;
+ }
+
/**
* write a message in the log
* @param string $app
@@ -36,6 +43,6 @@ class Errorlog implements IWriter {
* @param int $level
*/
public function write(string $app, $message, int $level) {
- error_log('[owncloud]['.$app.']['.$level.'] '.$message);
+ error_log('[' . $this->tag . ']['.$app.']['.$level.'] '.$message);
}
}