You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/10 10:35:52 UTC
[GitHub] [apisix] ly-hash opened a new issue #5037: request help: I want to add the result data of the request response to the access log
ly-hash opened a new issue #5037:
URL: https://github.com/apache/apisix/issues/5037
### 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 (cmd: `apisix version`): 2.9
- OS (cmd: `uname -a`): centOS7
- OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): 1.19.9.1
- etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
- apisix-dashboard version, if have:
- luarocks version, if the issue is about installation (cmd: `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] aikin-vip commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
aikin-vip commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-921584879
need this feature too!!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] zcstack commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
zcstack commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-921660989
建议开发者在现有的logger插件内支持响应body!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander closed issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
spacewander closed issue #5037:
URL: https://github.com/apache/apisix/issues/5037
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917967309
I find it difficult to log the response body in the log file(access.log, error.log), which involves the `log_format` directive.
But allowing it in a logging plugin like kafka-logger is possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-981213002
Solved by https://github.com/apache/apisix/pull/5550
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] ly-hash removed a comment on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
ly-hash removed a comment on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917816980
@toker,thank you very much
If I need to customize the result of the returned response, for example, instead of returning 404 or 500 information, it is a JSON structure, how should I modify it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] ly-hash commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
ly-hash commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917817775
@tzssangglass,I think you're right. It may be more convenient for users to make it into a plug-in
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] ly-hash commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
ly-hash commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917817343
@tokers,thank you very much
If I need to customize the result of the returned response, for example, instead of returning 404 or 500 information, it is a JSON structure, how should I modify it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] zcstack edited a comment on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
zcstack edited a comment on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-921660989
It is recommended that developers support the response body in existing Logger plug-ins!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917418654
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 `apisix/cli/ngx_tpl.lua` to add it (as currently, APISIX doesn't support to configure custom Nginx variables in config.yaml).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917649621
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] ly-hash commented on issue #5037: request help: I want to add the result data of the request response to the access log
Posted by GitBox <gi...@apache.org>.
ly-hash commented on issue #5037:
URL: https://github.com/apache/apisix/issues/5037#issuecomment-917816980
@toker,thank you very much
If I need to customize the result of the returned response, for example, instead of returning 404 or 500 information, it is a JSON structure, how should I modify it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org