-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request help: I want to add the result data of the request response to the access log #5037
Comments
You may have to collect the response body by concatenating them in the body_filter phase, you may serialize them into a Nginx variable and print it in the access log, since you need another Nginx variable, you may have to modify the |
It seems that there are some about this feature. For the response body, it can be logged in the log files, also in plugins such as kafka-logger, and pushed to the log server. |
@tokers,thank you very much |
@tzssangglass,I think you're right. It may be more convenient for users to make it into a plug-in |
I find it difficult to log the response body in the log file(access.log, error.log), which involves the But allowing it in a logging plugin like kafka-logger is possible. |
need this feature too!!! |
It is recommended that developers support the response body in existing Logger plug-ins! |
Solved by #5550 |
Issue description
I want to add the result data of the request response to the access log. Now it seems that only status is supported. What should I do? In addition, I want to return the response result of JSON. For the HTML returned now, the response code is also specified, such as 404,500. The return part of the code can be customized,thank you
Environment
apisix version
): 2.9uname -a
): centOS7nginx -V
oropenresty -V
): 1.19.9.1curl http://127.0.0.1:9090/v1/server_info
to get the info from server-info API):luarocks --version
):The text was updated successfully, but these errors were encountered: