how to store custom lua plugin logs to a file? #10830
Viveksingh1313
started this conversation in
General
Replies: 1 comment
-
Should be executed during the log phase |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have created a custom lua plugin which does authentication of a token and sets a few fields to headers before sending requests to upstream in apisix. I can use ngx.log to print logs on console. However I would like to write these logs to a file and also have a rolling file appender logic implemented. I used a library called https://lunarmodules.github.io/lualogging/ for rolling file appenders. However these logs are not working in rewrite phase(this is the phase where all my custom lua logic sits).
I don't understand why am I not able to write logs to a file in rewrite phase. The logs are also not getting stored in access.log and error.log files which is a nginx default feature.
Beta Was this translation helpful? Give feedback.
All reactions