Score:0

How can i add request id to nginx error log?

cn flag

I want to add request id which generated by nginx to nginx error log.

Example nginx access log:

200 [27/Sep/2021:12:12:39 +0300] ..101.24-- ..101.24 GET /?fname=%22+or+%22%22%3D%22&lname= HTTP/1.1 - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 **c85f0187b2cf1b15c24b6133b671f431

Is it possible also in error log?

us flag
You cannot customize error log contents. Also, I don't think that request ID is generated by nginx.
Ivan Shatsky avatar
gr flag
@TeroKilkanen As far as I can remember (I'm not sure) that number being logged in the nginx error log is a nginx worker ID.
Burak Çayır avatar
cn flag
Although nginx error log cannot be customized , nginx c code may be changed to do this.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.