j0ker
j0ker

Reputation: 4139

NGINX error log format documentation

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?

Upvotes: 57

Views: 37745

Answers (1)

mss
mss

Reputation: 1913

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

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.

Upvotes: 104

Related Questions