配置格式
- error_log log_file log_level
配置示例
- error_log logs/error.log error
以下是一些总结:
- 错误日志无法自定义日志格式,但是可以定义需要记录哪些错误等级的日志。
- 错误等级有:debug,info,notice,warn,error,crit,alert, oremerg。
- 默认记录 error等级的错误。
- debug错误等级对于排查线上问题比较有用。需要在安装时通过- --with-debug选项进行开启。- 参考
- ngx_core_module.html#error_log
- 链接
- Configuring the Nginx Error Log and Access Log