mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
Backend.php: syslog-ng migration (#5383)
This commit is contained in:
parent
dedb117935
commit
20744fcdbb
@ -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
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user