1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-18 15:18:08 +02:00
This commit is contained in:
Jordi Boggiano
2018-06-18 18:53:38 +02:00
parent fa9c4ebf3e
commit 41b8f5ebf4
29 changed files with 71 additions and 56 deletions

View File

@@ -40,6 +40,7 @@ class ErrorLogHandler extends AbstractProcessingHandler
if (false === in_array($messageType, self::getAvailableTypes(), true)) {
$message = sprintf('The given message type "%s" is not supported', print_r($messageType, true));
throw new \InvalidArgumentException($message);
}
@@ -73,9 +74,10 @@ class ErrorLogHandler extends AbstractProcessingHandler
{
if (!$this->expandNewlines) {
error_log((string) $record['formatted'], $this->messageType);
return;
}
}
$lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
foreach ($lines as $line) {
error_log($line, $this->messageType);