-
Notifications
You must be signed in to change notification settings - Fork 429
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
feat: Issue 166 json formatted logs #3376
feat: Issue 166 json formatted logs #3376
Conversation
Someone is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
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.
Hi @masmontanas, thanks for this PR, it looks really good on the whole! I've added a few minor comments but I think we can get this merged very soon for sure.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3376 +/- ##
==========================================
- Coverage 95.93% 95.91% -0.03%
==========================================
Files 1077 1083 +6
Lines 32950 33612 +662
==========================================
+ Hits 31612 32240 +628
- Misses 1338 1372 +34 ☔ View full report in Codecov by Sentry. |
…ing exception handling
Hi @matthewelwell , required updates are ready for review. Thank you. |
Hi @matthewelwell , I saw that e2e tests failed but doesn't seem to be related -- anything needed from my end? |
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'm approving this, but we need to be conscious that, from observability perspective, it isn't a great solution.
We need to evaluate integrating something like https://django-structlog.readthedocs.io/en/latest/ so Flagsmith provides truly insightful structured logs in the future.
@masmontanas I've approved, but it looks like you have some legit test failures to resolve. |
Fixed unit test issue. |
thanks again @masmontanas ! |
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
Extending logging.Formatter with a custom class for json formatted messages. Unfortunately specifying json format as a string in the LOGGING dictionary presented a corner-case with the axes module (which returns a dictionary [with double-quoted values] with request information). Traditional string formatting tokens also had to be replaced with '{}' since the tokens were not being interpolated properly after the logging formatter was added.
How did you test this code?
flagsmith:local
container locally.docker-compose.yaml
to useflagsmith:local
container.LOG_FORMAT: json