-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add implicit dump until level #82
Comments
I understand the point, that is to avoid logging twice one single entry. Now, we are using the hrtime/date to order the logs in ELK, but is that enough ? I'm thinking that this counter-intuitive way to log might confuse a lot of people that are going to investigate on our behalf (DOGS, TS) |
Yes, this is something that has been bugging me as well (hence the issue to pick each of our brain) and it's a proposal, so we can discuss the options we have. The current implementation we have is causing confusion for DOGS/TS as well. For example, when there is an error in S3, it prints two log entries {"name":"S3","clientIP":"redacted","clientPort":37224,"httpMethod":"GET","httpURL":"/foo_object","time":1477540451068,"req_id":"22220a8facd6cadb3ba6","level":"info","message":"received request","hostname":"redacted","pid":165}
{"name":"S3","clientIP":"redacted","clientPort":37224,"httpMethod":"GET","httpURL":"/foo_object","time":1477540451068,"req_id":"22220a8facd6cadb3ba6","level":"info","message":"received request","hostname":"redacted","pid":165} This spawned a whole confusion as to how S3 was getting the same request twice, while in reality the log lines were being printed twice. From what I can see we could
{"name":"S3","message":"received request","clientIP":"redacted","clientPort":37224,"httpMethod":"GET","httpURL":"/foo_object","time":1477540451068,"req_id":"22220a8facd6cadb3ba6","level":"info","hostname":"redacted","pid":165}
{"name":"S3","message":"dump logs start","clientIP":"redacted","clientPort":37224,"httpMethod":"GET","httpURL":"/foo_object","time":1477540451068,"req_id":"22220a8facd6cadb3ba6","level":"info","hostname":"redacted","pid":165}
{"name":"S3","message":"received request","clientIP":"redacted","clientPort":37224,"httpMethod":"GET","httpURL":"/foo_object","time":1477540451068,"req_id":"22220a8facd6cadb3ba6","level":"info","hostname":"redacted","pid":165}
...
...
{"name":"S3","message":"dump logs end","clientIP":"redacted","clientPort":37224,"httpMethod":"GET","httpURL":"/foo_object","time":1477540451068,"req_id":"22220a8facd6cadb3ba6","level":"info","hostname":"redacted","pid":165} |
Mhhhh... Well, this makes sense to me at least, unless someone has a better suggestion. Anyways, this behavior must be properly documented in the RequesTLogger class documentation when implementing it. |
Typical configuration for logging is
This would make INFO level log print twice.
Proposed solution:
When dumping logs print until (logLevel - 1) level i.e. in this example, all log entries with levels ERROR, TRACE, DEBUG will be printed when dumping the logs and not INFO.
The text was updated successfully, but these errors were encountered: