1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-23 17:46:09 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2016-11-15 13:16:37 +01:00
2 changed files with 21 additions and 1 deletions

View File

@@ -115,13 +115,23 @@ class StreamHandler extends AbstractProcessingHandler
flock($this->stream, LOCK_EX);
}
fwrite($this->stream, (string) $record['formatted']);
$this->streamWrite($this->stream, $record);
if ($this->useLocking) {
flock($this->stream, LOCK_UN);
}
}
/**
* Write to stream
* @param resource $stream
* @param array $record
*/
protected function streamWrite($stream, array $record)
{
fwrite($stream, (string) $record['formatted']);
}
private function customErrorHandler($code, $msg)
{
$this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);