voodoo-dn commented on pull request #1992:
URL: https://github.com/apache/thrift/pull/1992#issuecomment-705795242
> Logging is certainly important, but I'm so sure how important it is to log
all requests/responses for every request.
Logs collecting is cheap, but allows you to reproduce system behavior. When
you works with microservices, it's must have feature to log everything.
> Granted everyone's situation is different, but my experience is that we
only log errors in production, and in most cases the error messages have enough
information to debug the issue. And if that's not enough, in most of (our)
cases it's not something in the request, more logging/metrics near the place
the error happens are much more useful than just logging the whole request.
For example: some your endpoints starts return internal errors. You do not
have middlewares, you haven't added any logging to thrift handler. What will
you do? Do hotfix on production and add logger?)
> "Weaker type system" is in refer to the usage of `interface{}` as the type
of the requests/responses.
I understand. I can make arg and result as TStruct, it's not a problem.
> > What is maskArg do: marshal args to json, then we cut from json some
sensitive data and log this json.
>
> The cutting part sounds very inefficient if you are doing that after
marshaled to json. Do you unmarshal json again to strip the sensitive data, or
use some regexp to manipulate the json string directly? (this is purely my
curiosity, nothing to do with this PR)
Yes, there is not the efficient algorithm, we will fix it when we might have
problems with performance.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]