awslog用于PHP日志文件
我已经实现了Syslogs的AWSlogs,以在云手表上推动日志,并且工作正常。 但是,当我试图记录PHP错误时,它会观察错误,但是错误的时间不准确。
我的awslogs.config
datetime_format = [%Y-%m-%dT%H:%M:%S]
file = /var/log/dev.log
buffer_duration = 5000
log_stream_name = {instance_id}
initial_position = start_of_file
log_group_name = /var/log/dev.log
dev.log
[2022-06-09T12:27:51.280621+00:00] doctrine.INFO: Disconnecting [] []
[2022-06-09T12:27:51.280621+00:00] doctrine.INFO: Disconnecting [] []
云手表
2022-06-28T13:04:55.279+02:00 [2022-06-09T12:26:51.280621+00:00] doctrine.INFO: Disconnecting [] []
2022-06-28T13:04:55.279+02:00 [2022-06-09T12:27:51.280621+00:00] doctrine.INFO: Disconnecting [] []
I have implemented awslogs for syslogs to push logs on cloud watch and is working fine.
but when I am trying to log PHP errors it watches the error but the time of the error is not accurate.
My awslogs.config
datetime_format = [%Y-%m-%dT%H:%M:%S]
file = /var/log/dev.log
buffer_duration = 5000
log_stream_name = {instance_id}
initial_position = start_of_file
log_group_name = /var/log/dev.log
dev.log
[2022-06-09T12:27:51.280621+00:00] doctrine.INFO: Disconnecting [] []
[2022-06-09T12:27:51.280621+00:00] doctrine.INFO: Disconnecting [] []
CLoud watch
2022-06-28T13:04:55.279+02:00 [2022-06-09T12:26:51.280621+00:00] doctrine.INFO: Disconnecting [] []
2022-06-28T13:04:55.279+02:00 [2022-06-09T12:27:51.280621+00:00] doctrine.INFO: Disconnecting [] []
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,我的错误不是缺少适当的 dateTime_format
%f,这是日志中显示的浮数。
应该是
Sorry, my mistake was not implementing a proper datetime_format
%f was missing which is a floating number shown in logs.
It should be