smallnest / rpcx

Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! 𝐉𝐚𝐯𝐚有𝐝𝐮𝐛𝐛𝐨, 𝐆𝐨𝐥𝐚𝐧𝐠有𝐫𝐩𝐜𝐱! build for cloud!
https://rpcx.io
Other
8.11k stars 1.17k forks source link

plugins print all request log #818

Closed BlackSinny closed 1 year ago

BlackSinny commented 1 year ago
  1. plugins receive request,get request begin time(t1)
  2. run service code ...
  3. plugins return request(t2)

how i want to do

rpcx framework can print log contain duration[t2-t1],request body、url and so on...

my guess

i used to achieve it in gin middleware,and i want to do it in rpcx plugins

smallnest commented 1 year ago

Maybe you should see https://github.com/smallnest/rpcx/blob/master/server/plugin.go and implement your plugins.

see some examples: https://github.com/rpcxio/rpcx-examples/tree/master/plugin https://github.com/rpcxio/rpcx-examples/tree/master/plugin_blacklist