mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Merge pull request #410 from harrytruong/master
PsrLogMessageProcessor updated to add valid string conversion conditions
This commit is contained in:
@@ -32,7 +32,11 @@ class PsrLogMessageProcessor
|
||||
|
||||
$replacements = array();
|
||||
foreach ($record['context'] as $key => $val) {
|
||||
$replacements['{'.$key.'}'] = $val;
|
||||
if (is_null($val) ||
|
||||
is_scalar($val) ||
|
||||
(is_object($val) && method_exists($val, "__toString"))) {
|
||||
$replacements['{'.$key.'}'] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$record['message'] = strtr($record['message'], $replacements);
|
||||
|
Reference in New Issue
Block a user