NGINX错误日志格式文档 [英] NGINX error log format documentation

查看:142
本文介绍了NGINX错误日志格式文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想解析NGINX错误日志.但是,似乎根本没有关于所用日志格式的文档.虽然某些字段(如数据)的含义很明显,但有些却根本没有.另外,如果我没有所有可能字段的文档,则不能确定我的解析器是否完整.既然您似乎可以更改访问日志格式,但不能更改错误日志的格式,那么我真的不知道如何获取所需的信息.

I want to parse NGINX error logs. However, there seems to be no documentation at all, concerning the used log format. While the meaning of some fields like the data is pretty obvious, some are not at all. In addition, I cannot be sure that my parser is complete if I do not have a documentation of all the possible fields. Since it seems you can change the access log format, but not that of the error log, I really have no idea how to get the information I need.

有人知道这样的文档吗?

Does anyone know of such a documentation?

推荐答案

从阅读 src/core/ngx_log.c 我想一般的错误日志格式似乎是

From reading src/core/ngx_log.c I guess the general error log format seems to be

YYYY/MM/DD HH:MM:SS [LEVEL] PID#TID: *CID MESSAGE

其中PIDTID是日志记录过程,线程ID,而CID是标识(可能是代理)连接的数字,可能是计数器. *CID部分是可选的.

With PID and TID being the logging process and thread id and CID a number identifying a (probably proxied) connection, probably a counter. The *CID part is optional.

这篇关于NGINX错误日志格式文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆