jinjianming commented on issue #9536:
URL: https://github.com/apache/apisix/issues/9536#issuecomment-1611197809

   This is the operation of my file logger plugin
   
   ```file-logger
   Log format
   curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/file-logger \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "log_format": {
           "client_ip": "$remote_addr",
           "remote_user": "$remote_user",
           "time_local": "$time_local",
           "method": "$request_method",
           "uri": "$request_uri",
           "status": "$status",
           "version": "$server_protocol",
           "body_bytes_sent": "$body_bytes_sent",
           "http_referer": "$http_referer",
           "http_x_register_referrer": "$http_x_register_referrer",
           "http_user_agent": "$http_user_agent",
           "request_length": "$request_length",
           "upstream_connect_time": "$upstream_connect_time",
           "upstream_header_time": "$upstream_header_time",
           "request_time": "$request_time",
           "upstream_addr": "$upstream_addr",
           "reoute_id": "$reoute_id",
           "upstream_response_length": "$upstream_response_length",
           "upstream_response_time": "$upstream_response_time",
           "upstream_status": "$upstream_status",
           "host": "$host",
           "req_id": "$request_id"
       }
   }'
   
   Enable Global
   
   curl http://127.0.0.1:9180/apisix/admin/global_rules/1  \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
     "plugins": {
       "file-logger": {
         "path": "logs/access.log"
       }
     }
   }'```


-- 
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