mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-24 18:16:10 +02:00
Added the support of a logging context
This commit is contained in:
@@ -36,7 +36,7 @@ abstract class AbstractProcessingHandler extends AbstractHandler
|
||||
|
||||
$record = $this->processRecord($record);
|
||||
|
||||
$record['message'] = $this->getFormatter()->format($record);
|
||||
$record['formatted'] = $this->getFormatter()->format($record);
|
||||
|
||||
$this->write($record);
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class FirePHPHandler extends AbstractProcessingHandler
|
||||
// but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake.
|
||||
return $this->createHeader(
|
||||
array(1, 1, 1, self::$messageIndex++),
|
||||
$record['message']
|
||||
$record['formatted']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ abstract class MailHandler extends AbstractProcessingHandler
|
||||
}
|
||||
|
||||
if (!empty($messages)) {
|
||||
$this->send($this->getFormatter()->formatBatch($messages));
|
||||
$this->send((string) $this->getFormatter()->formatBatch($messages));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,6 @@ abstract class MailHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
$content = $record['message'];
|
||||
|
||||
$this->send($content);
|
||||
$this->send((string) $record['formatted']);
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,6 @@ class StreamHandler extends AbstractProcessingHandler
|
||||
throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened; it may be invalid or not writable.', $this->url));
|
||||
}
|
||||
}
|
||||
fwrite($this->stream, (string) $record['message']);
|
||||
fwrite($this->stream, (string) $record['formatted']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,6 @@ class SyslogHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
syslog($this->logLevels[$record['level']], (string) $record['message']);
|
||||
syslog($this->logLevels[$record['level']], (string) $record['formatted']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user