Backend.php: syslog-ng migration (#5383)

This commit is contained in:
kulikov-a 2022-01-18 16:53:40 +03:00 committed by GitHub
parent dedb117935
commit 20744fcdbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,7 @@ namespace OPNsense\Core;
use Phalcon\Logger;
use Phalcon\Logger\Adapter\Syslog;
use Phalcon\Logger\Formatter\Line;
/**
* Class Backend
@ -54,15 +55,20 @@ class Backend
* @param string $ident syslog identifier
* @return Syslog log handler
*/
protected function getLogger($ident = 'configd')
protected function getLogger($ident = 'configd.py')
{
$formatter = new Line('%message%');
$adapter = new Syslog($ident,
[
'option' => LOG_PID,
'facility' => LOG_LOCAL4,
]
);
$adapter->setFormatter($formatter);
$logger = new Logger(
'messages',
[
'main' => new Syslog($ident, array(
'option' => LOG_PID,
'facility' => LOG_LOCAL4
))
'main' => $adapter
]
);