diff options
Diffstat (limited to 'lib/private/Log/LogFactory.php')
-rw-r--r-- | lib/private/Log/LogFactory.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Log/LogFactory.php b/lib/private/Log/LogFactory.php index 7064fe324e6..6e6ded3758b 100644 --- a/lib/private/Log/LogFactory.php +++ b/lib/private/Log/LogFactory.php @@ -31,6 +31,7 @@ use OCP\ILogger; use OCP\IServerContainer; use OCP\Log\ILogFactory; use OCP\Log\IWriter; +use Psr\Log\LoggerInterface; class LogFactory implements ILogFactory { /** @var IServerContainer */ @@ -70,6 +71,13 @@ class LogFactory implements ILogFactory { return new Log($log, $this->systemConfig); } + public function getCustomPsrLogger(string $path): LoggerInterface { + $log = $this->buildLogFile($path); + return new PsrLoggerAdapter( + new Log($log, $this->systemConfig) + ); + } + protected function buildLogFile(string $logFile = ''):File { $defaultLogFile = $this->systemConfig->getValue('datadirectory', \OC::$SERVERROOT.'/data').'/nextcloud.log'; if ($logFile === '') { |