File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,18 @@ class Syslog extends LogDetails implements IWriter {
20
20
ILogger::FATAL => LOG_CRIT ,
21
21
];
22
22
23
+ private string $ tag ;
24
+
23
25
public function __construct (
24
26
SystemConfig $ config ,
25
27
?string $ tag = null ,
26
28
) {
27
29
parent ::__construct ($ config );
28
30
if ($ tag === null ) {
29
- $ tag = $ config ->getValue ('syslog_tag ' , 'Nextcloud ' );
31
+ $ this ->tag = $ config ->getValue ('syslog_tag ' , 'Nextcloud ' );
32
+ } else {
33
+ $ this ->tag = $ tag ;
30
34
}
31
- openlog ($ tag , LOG_PID | LOG_CONS , LOG_USER );
32
35
}
33
36
34
37
public function __destruct () {
@@ -41,6 +44,7 @@ public function __destruct() {
41
44
*/
42
45
public function write (string $ app , $ message , int $ level ): void {
43
46
$ syslog_level = $ this ->levels [$ level ];
47
+ openlog ($ this ->tag , LOG_PID | LOG_CONS , LOG_USER );
44
48
syslog ($ syslog_level , $ this ->logDetailsAsJSON ($ app , $ message , $ level ));
45
49
}
46
50
}
You can’t perform that action at this time.
0 commit comments