beginnerWJC commented on issue #189:
URL: 
https://github.com/apache/apisix-java-plugin-runner/issues/189#issuecomment-1226782760

   有看过代理的上游的日志吗?java plugin runner的日志里面我也只会打印一次,但是在代理的上游日志里面看到了两次调用的日志。
   我是配置了APISIX的debug.yaml,开启了基本调试模式
   ```
   basic:
         enable: true
   ```
   APISIX的日志:
   ```
   2022/08/25 05:01:15 [warn] 57#57: *191 [lua] init.lua:913: 08/25 
05:01:15.190 [epollEventLoopGroup-2-1] INFO  
[o.a.a.p.runner.filter.TestPostFilter] -TestPostFilter插件开始执行!
   , context: ngx.timer
   2022/08/25 05:01:15 [warn] 57#57: *191 [lua] init.lua:913: 08/25 
05:01:15.191 [epollEventLoopGroup-2-1] INFO  
[o.a.a.p.runner.filter.TestPostFilter] -上游返回的headers:{"Date":"Thu, 25 Aug 2022 
05:01:15 GMT"}
   , context: ngx.timer
   2022/08/25 05:01:15 [warn] 57#57: *191 [lua] init.lua:913: 08/25 
05:01:15.191 [epollEventLoopGroup-2-1] INFO  
[o.a.a.p.runner.filter.TestPostFilter] -上游返回的状态码为:204
   , context: ngx.timer
   2022/08/25 05:01:15 [warn] 48#48: *849033 [lua] plugin.lua:384: 
trace_plugins_info_for_debug(): Apisix-Plugins: prometheus while sending to 
client, client: 172.17.67.0, server: _, request: "GET 
/robot-monitor/v1/robotMonitor/test204 HTTP/1.1", upstream: 
"http://192.168.2.120:8900/robot-monitor/v1/robotMonitor/test204";, host: 
"192.168.40.174:30880"
   2022/08/25 05:01:15 [warn] 48#48: *849033 [lua] plugin.lua:384: 
trace_plugins_info_for_debug(): Apisix-Plugins: prometheus while sending to 
client, client: 172.17.67.0, server: _, request: "GET 
/robot-monitor/v1/robotMonitor/test204 HTTP/1.1", upstream: 
"http://192.168.2.120:8900/robot-monitor/v1/robotMonitor/test204";, host: 
"192.168.40.174:30880"
   2022/08/25 05:01:15 [warn] 48#48: *849033 [lua] plugin.lua:384: 
trace_plugins_info_for_debug(): Apisix-Plugins: prometheus while logging 
request, client: 172.17.67.0, server: _, request: "GET 
/robot-monitor/v1/robotMonitor/test204 HTTP/1.1", upstream: 
"http://192.168.2.120:8900/robot-monitor/v1/robotMonitor/test204";, host: 
"192.168.40.174:30880"
   172.17.67.0 - - [25/Aug/2022:05:01:15 +0000] 192.168.40.174:30880 "GET 
/robot-monitor/v1/robotMonitor/test204 HTTP/1.1" 204 0 0.010 "-" 
"PostmanRuntime/7.28.4" 192.168.2.120:8900 204 0.004 
"http://192.168.40.174:30880";
   ```
   java plugin runner的日志:
   ```
   08/25 05:01:15.190 [epollEventLoopGroup-2-1] INFO  
[o.a.a.p.runner.filter.TestPostFilter] -TestPostFilter插件开始执行!
   08/25 05:01:15.191 [epollEventLoopGroup-2-1] INFO  
[o.a.a.p.runner.filter.TestPostFilter] -上游返回的headers:{"Date":"Thu, 25 Aug 2022 
05:01:15 GMT"}
   08/25 05:01:15.191 [epollEventLoopGroup-2-1] INFO  
[o.a.a.p.runner.filter.TestPostFilter] -上游返回的状态码为:204
   ```
   代理的上游显示的日志:
   ```
   2022-08-25 13:01:15.175  INFO 28652 --- [  XNIO-1 task-3] 
c.w.controller.RobotMonitorController    : test204
   2022-08-25 13:01:15.175  INFO 28652 --- [  XNIO-1 task-3] 
com.wellcloud.common.aspect.LogAspect    : request: test204, cost: 0
   2022-08-25 13:01:15.180  INFO 28652 --- [  XNIO-1 task-4] 
c.w.controller.RobotMonitorController    : test204
   2022-08-25 13:01:15.181  INFO 28652 --- [  XNIO-1 task-4] 
com.wellcloud.common.aspect.LogAspect    : request: test204, cost: 1
   ```
   
   


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