-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make logs more grepable #1008
Comments
I have actually already implemented it locally for debugging of heal issues found during scalability testing. It helps a lot. |
@d-uzlov Be free to open PR! |
As a side note, in the sdk-vpp code, I do my internal logs at |
I like this idea very much... but there's one practical corner case... what do we do in the case where we haven't got a Connection ID yet? I suspect this is quite solvable... but will need to be solved :) |
When I was doing my testing, I was getting connection ID in 2 ways:
|
PR #1012 is not looking great for us and we want to consider a list of improvements for logs in term of the issue. |
@edwarnicke Finally, all PRs are merged! @Mixaster995 Thanks! |
Overview
Right now we have automatic trace logs for network services and registries.
They have some annoying issues:
info
levelThese issues make it difficult to read the logs. It's next to impossible to tell what is going on when there are even mere dozens of requests.
Solution
The obvious choice would be
trace
. However, our "trace" logs are actually not so detailed. If we were to add a lot of logs inside some chain elements, then we would probably want to be able to distinguish out current trace logs from them, so maybe it would be better to log them atdebug
level.We would still have issues with multiline logs, since they only have logger fields in their first line.
Most of our log entries are single lines, and the vast majority of multiline entries are stack traces from errors, so this is not a big problem.
The size increase due to adding ID to each line is minor, in comparison to our current logs size. However, we would be able to use, for example,
grep 9763b41a-2ff6-40e3-8475-7d9dae986f13
, to reduce the big log file to only the important part.Implementation
sdk/pkg/tools/log/logruslogger/logruslogger.go
Line 217 in d4734b5
log.WithFields
(same for other trace elements):sdk/pkg/networkservice/core/trace/server.go
Line 75 in d4734b5
The text was updated successfully, but these errors were encountered: