Processes a record's message according to PSR-3 rules.
More...
Processes a record's message according to PSR-3 rules.
It replaces {foo} with the value from $context['foo']
- Author
- Jordi Boggiano j.bog.nosp@m.gian.nosp@m.o@sel.nosp@m.d.be
Definition at line 21 of file PsrLogMessageProcessor.php.
◆ __invoke()
Monolog\Processor\PsrLogMessageProcessor::__invoke |
( |
array |
$record | ) |
|
- Parameters
-
- Returns
- array
Definition at line 27 of file PsrLogMessageProcessor.php.
References array.
29 if (
false === strpos($record[
'message'],
'{')) {
33 $replacements =
array();
34 foreach ($record[
'context'] as $key => $val) {
35 if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val,
"__toString"))) {
36 $replacements[
'{'.$key.
'}'] = $val;
37 } elseif (is_object($val)) {
38 $replacements[
'{'.$key.
'}'] =
'[object '.get_class($val).
']';
40 $replacements[
'{'.$key.
'}'] =
'['.gettype($val).
']';
44 $record[
'message'] = strtr($record[
'message'], $replacements);
Create styles array
The data for the language used.
The documentation for this class was generated from the following file: