-
Notifications
You must be signed in to change notification settings - Fork 0
Scc 4840/json logging WIP #46
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
Conversation
I think you should use the real thing. In my opinion it only needs to be mocked when testing other methods that happen to use logging, not when logging is the point of the test. |
|
The tests that are failing are from a completely different part of the code, and are also broken in main. I'm going to make a ticket for fixing them and not have them block this work. |
I wanted to see if I could fix the failing test but the failure isn't reproducing for me on the main branch- or your branch checked out locally, for that matter. I re-ran the test in GH and an additional test failed. Mysterious. I agree with your assessment that this failure isn't caused by your change- Tentatively approving this so we can unblock experimenting with structured logging in our python apps |
yossariano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in our 1:1- I'm interested in seeing how well this plays with cloudwatch logging. But I don't think if there's a problem there that the fix will be needed in this package.
| processors=[ | ||
| structlog.processors.add_log_level, | ||
| structlog.processors.TimeStamper(fmt="iso"), | ||
| structlog.processors.EventRenamer("message"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully recall why I changed this from the default event to message in eReading- I think the change is fine but we should keep it in mind in case there's anything that expects event as a field in structured logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that the winston json logging sets the first param as message in the json object, so this would ensure parity with that.
Add optional json logger using structlog.