gracekk opened a new issue, #7296:
URL: https://github.com/apache/apisix/issues/7296

   ### Description
   
   I try to use $resp_body in config.yml but failed. 
   Any ideas?
   Or Can I use http-logger plugin write resp_body into file?
   
   
   nginx_config:
     http:
       error_log_level: "info"
       enable_access_log: true
       access_log: logs/access.log
       access_log_format: 
'{"@timestamp":"$time_iso8601","host":"$hostname","server_ip":"$server_addr","client_ip":"$remote_addr","xff":"$http_x_forwarded_for","domain":"$host","url":"$uri","referer":"$http_referer","args":"$args","upstreamtime":"$upstream_response_time","responsetime":"$request_time","request_method":"$request_method","status":"$status","size":"$body_bytes_sent","resp_body":"$resp_body","request_body":"$request_body","request_length":"$request_length","protocol":"$server_protocol","upstreamhost":"$upstream_addr","file_dir":"$uri","http_user_agent":"$http_user_agent"}'
       access_log_format_escape: json
     http_configuration_snippet: |
       log_format  my-custom-logs-format
       '{"@timestamp":"$time_iso8601",'
       '"host":"$hostname",'
       '"server_ip":"$server_addr",'
       '"client_ip":"$remote_addr",'
       '"xff":"$http_x_forwarded_for",'
       '"domain":"$host",'
       '"url":"$uri",'
       '"referer":"$http_referer",'
       '"args":"$args",'
       '"upstreamtime":"$upstream_response_time",'
       '"responsetime":"$request_time",'
       '"request_method":"$request_method",'
       '"status":"$status",'
       '"size":"$body_bytes_sent",'
       '"request_body":"$request_body",'
       '"request_length":"$request_length",'
       '"protocol":"$server_protocol",'
       '"upstreamhost":"$upstream_addr",'
       '"file_dir":"$uri",'
       '"resp_body:"$resp_body",'
       '"http_user_agent":"$http_user_agent"'
       '}';
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to