99
1010namespace OCA \AdminAudit ;
1111
12+ use OCP \AppFramework \Services \IAppConfig ;
1213use OCP \IConfig ;
1314use OCP \Log \ILogFactory ;
1415use Psr \Log \LoggerInterface ;
@@ -20,7 +21,11 @@ class AuditLogger implements IAuditLogger {
2021
2122 private LoggerInterface $ parentLogger ;
2223
23- public function __construct (ILogFactory $ logFactory , IConfig $ config ) {
24+ public function __construct (
25+ ILogFactory $ logFactory ,
26+ IAppConfig $ appConfig ,
27+ IConfig $ config ,
28+ ) {
2429 $ auditType = $ config ->getSystemValueString ('log_type_audit ' , 'file ' );
2530 $ defaultTag = $ config ->getSystemValueString ('syslog_tag ' , 'Nextcloud ' );
2631 $ auditTag = $ config ->getSystemValueString ('syslog_tag_audit ' , $ defaultTag );
@@ -29,7 +34,7 @@ public function __construct(ILogFactory $logFactory, IConfig $config) {
2934 if ($ auditType === 'file ' && !$ logFile ) {
3035 $ default = $ config ->getSystemValue ('datadirectory ' , \OC ::$ SERVERROOT . '/data ' ) . '/audit.log ' ;
3136 // Legacy way was appconfig, now it's paralleled with the normal log config
32- $ logFile = $ config -> getAppValue ( ' admin_audit ' , 'logfile ' , $ default );
37+ $ logFile = $ appConfig -> getAppValueString ( 'logfile ' , $ default );
3338 }
3439
3540 $ this ->parentLogger = $ logFactory ->getCustomPsrLogger ($ logFile , $ auditType , $ auditTag );
0 commit comments