在我的Symfony 3.4里。应用程序我已经配置了一个自定义记录器:
monolog:
handlers:
my_channel:
level: debug
type: stream
path: '%kernel.logs_dir%/my_channel.log'
max_files: 10
channels: [my_channel]当我在我的代码中使用这个记录器时,我正确地注入了通道"my_channel“。
$this->logger->error('error message', $data = ['my context here']);在屏幕上,我得到了正确显示的$data信息:
09:00:08 ERROR [my_channel] error message ["my context here"]但在我的日志中,上下文是空的:
09:00:08 ERROR [my_channel] error message []问题:如何将上下文也记录到日志文件中?
发布于 2017-12-01 10:46:06
原因是上下文数据没有被UTF-8编码.
https://stackoverflow.com/questions/47589964
复制相似问题