是否可以在 Nginx 上指定自定义错误日志格式? [英] Is it possible to specify custom error log format on Nginx?
本文介绍了是否可以在 Nginx 上指定自定义错误日志格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在 Nginx 上为 access_log
指定自定义日志格式,但它不适用于 error_log
.
I can specify custom log format for access_log
on Nginx, but it doesn't work for error_log
.
有没有办法做到这一点?
Is there anyway to achieve this?
推荐答案
你不能指定自己的格式,但是在 nginx 中内置了几个级别的 error_log-ing.
You can't specify your own format, but in nginx build-in several level's of error_log-ing.
语法:error_log 文件 [ debug |信息 |通知 |警告 |错误 |暴击]
默认值:${prefix}/logs/error.log
指定记录服务器(和 fastcgi)错误的文件.
Specifies the file where server (and fastcgi) errors are logged.
错误级别的默认值:
- 在主要部分 - 错误
- 在 HTTP 部分 - 暴击
- 在服务器部分 - 暴击
在我的 error_log 中,时间总是显示在日志中每个错误字符串的 int begin.
In my error_log, time always presented int begin of each error string in log.
这篇关于是否可以在 Nginx 上指定自定义错误日志格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文