1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-20 08:06:19 +02:00

Add Level::toRFC5424Level method and restore BC to Syslog handlers (broken in #1689)

This commit is contained in:
Jordi Boggiano
2022-07-22 17:04:34 +02:00
parent 7d31b642bd
commit f7dfa00f08
9 changed files with 44 additions and 36 deletions

View File

@@ -40,6 +40,14 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler
'uucp' => \LOG_UUCP,
];
/**
* Translates Monolog log levels to syslog log priorities.
*/
protected function toSyslogPriority(Level $level): int
{
return $level->toRFC5424Level();
}
/**
* @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant
*/