File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/Symfony/Bridge/Monolog/Formatter Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,20 @@ public function format(array $record)
117
117
$ levelColor = self ::$ levelColorMap [$ record ['level ' ]];
118
118
119
119
if ($ this ->options ['multiline ' ]) {
120
- $ context = $ extra = "\n" ;
120
+ $ separator = "\n" ;
121
121
} else {
122
- $ context = $ extra = ' ' ;
122
+ $ separator = ' ' ;
123
+ }
124
+
125
+ $ context = $ this ->dumpData ($ record ['context ' ]);
126
+ if ($ context ) {
127
+ $ context = $ separator .$ context ;
128
+ }
129
+
130
+ $ extra = $ this ->dumpData ($ record ['extra ' ]);
131
+ if ($ extra ) {
132
+ $ extra = $ separator .$ extra ;
123
133
}
124
- $ context .= $ this ->dumpData ($ record ['context ' ]);
125
- $ extra .= $ this ->dumpData ($ record ['extra ' ]);
126
134
127
135
$ formatted = strtr ($ this ->options ['format ' ], array (
128
136
'%datetime% ' => $ record ['datetime ' ]->format ($ this ->options ['date_format ' ]),
You can’t perform that action at this time.
0 commit comments