From 2133e01288f8f974645c6548ba1250b5c61d68bc Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 13 Nov 2016 20:36:07 +0100 Subject: [PATCH 1/3] Prepare 1.22 changelog --- CHANGELOG.mdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.mdown b/CHANGELOG.mdown index 5f81e24f..79bf6285 100644 --- a/CHANGELOG.mdown +++ b/CHANGELOG.mdown @@ -1,3 +1,13 @@ +### 1.22.0 (2016-11-XX) + + * Added MercurialProcessor to add mercurial revision and branch names to log records + * Added support for AWS SDK v3 in DynamoDbHandler + * Fixed fatal errors occuring when normalizing generators that have been fully consumed + * Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix) + * Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore + * Fixed SyslogUdpHandler to avoid sending empty frames + * Fixed a few PHP7 compatibility issues + ### 1.21.0 (2016-07-29) * Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues From 09a68c81e3f764212283c71d608e2ce060ba8339 Mon Sep 17 00:00:00 2001 From: Jay MOULIN Date: Mon, 14 Nov 2016 23:35:47 +0100 Subject: [PATCH 2/3] isolate fwrite to allow override --- src/Monolog/Handler/StreamHandler.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Monolog/Handler/StreamHandler.php b/src/Monolog/Handler/StreamHandler.php index b084f1a7..9185929f 100644 --- a/src/Monolog/Handler/StreamHandler.php +++ b/src/Monolog/Handler/StreamHandler.php @@ -113,13 +113,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); From f1d2b090d54683396ebdf2c705d5a913512602af Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 15 Nov 2016 13:16:16 +0100 Subject: [PATCH 3/3] CS --- src/Monolog/Handler/StreamHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Monolog/Handler/StreamHandler.php b/src/Monolog/Handler/StreamHandler.php index 9185929f..09a15738 100644 --- a/src/Monolog/Handler/StreamHandler.php +++ b/src/Monolog/Handler/StreamHandler.php @@ -127,7 +127,7 @@ class StreamHandler extends AbstractProcessingHandler */ protected function streamWrite($stream, array $record) { - fwrite($stream, (string)$record['formatted']); + fwrite($stream, (string) $record['formatted']); } private function customErrorHandler($code, $msg)