You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Nginx error logger seems to not expect linebreaks in error log and there is no mechanism in place to properly handle them. On the Lua side of the OpenResty, the main thing that creates a log with linebreaks is the Lua stacktrace. This creates a particular issue when the error log output is directed to a syslog server, the Nginx will write the lines with only 1 syslog header, making the subsequent lines unparseable.
Take this log line for example:
2024/11/16 00:08:28 [error] 143589#143589: *1885879 lua entry thread aborted: runtime error: error loading module '***' from file '/etc/openresty/lualib/test.lua':
/etc/openresty/lualib/test.lua:28: unexpected symbol near '{'
stack traceback:
coroutine 0:
[C]: in function 'require'
/etc/openresty/test.lua:1: in main chunk, client: ***, server: ***, request: "OPTIONS *** HTTP/1.1", host: "***", referrer: "***"
According to the syslog spec, it should write the following thing to socket:
<34>Oct 11 22:14:15 mymachine nginx: 2024/11/16 00:08:28 [error] 143589#143589: *1885879 lua entry thread aborted: runtime error: error loading module '***' from file '/etc/openresty/lualib/test.lua':
/etc/openresty/lualib/test.lua:28: unexpected symbol near '{'
stack traceback:
coroutine 0:
[C]: in function 'require'
/etc/openresty/test.lua:1: in main chunk, client: ***, server: ***, request: "OPTIONS *** HTTP/1.1", host: "***", referrer: "***"
This could as well be an Nginx issue, but I'm not aware of any multiline error logs produced by vanilla Nginx, so they might not be responsible for this.
The Nginx error logger seems to not expect linebreaks in error log and there is no mechanism in place to properly handle them. On the Lua side of the OpenResty, the main thing that creates a log with linebreaks is the Lua stacktrace. This creates a particular issue when the error log output is directed to a syslog server, the Nginx will write the lines with only 1 syslog header, making the subsequent lines unparseable.
Take this log line for example:
According to the syslog spec, it should write the following thing to socket:
In reality, this is written:
This could as well be an Nginx issue, but I'm not aware of any multiline error logs produced by vanilla Nginx, so they might not be responsible for this.
See:
https://nginx.org/en/docs/syslog.html
The text was updated successfully, but these errors were encountered: