Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/admin_audit')
-rw-r--r--apps/admin_audit/lib/AppInfo/Application.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php
index 7b5fb520bc9..594e1c7f2c4 100644
--- a/apps/admin_audit/lib/AppInfo/Application.php
+++ b/apps/admin_audit/lib/AppInfo/Application.php
@@ -96,15 +96,19 @@ class Application extends App implements IBootstrap {
}
private function getLogger(IConfig $config,
- LoggerInterface $logger,
ILogFactory $logFactory): LoggerInterface {
- $default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log';
- $logFile = $config->getAppValue('admin_audit', 'logfile', $default);
-
- if ($logFile === null) {
- return $logger;
+ $auditType = $config->getSystemValueString('log_type_audit', 'file');
+ $defaultTag = $config->getSystemValueString('syslog_tag', 'Nextcloud');
+ $auditTag = $config->getSystemValueString('syslog_tag_audit', $defaultTag);
+ $logFile = $config->getSystemValueString('logfile_audit', '');
+
+ if ($auditType === 'file' && !$logFile) {
+ $default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log';
+ // Legacy way was appconfig, now it's paralleled with the normal log config
+ $logFile = $config->getAppValue('admin_audit', 'logfile', $default);
}
- return $logFactory->getCustomPsrLogger($logFile);
+
+ return $logFactory->getCustomPsrLogger($logFile, $auditType, $auditTag);
}
/**