Skip to content
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

structured logging #93

Merged
merged 19 commits into from
Oct 25, 2024
Merged

structured logging #93

merged 19 commits into from
Oct 25, 2024

Conversation

ericbuckley
Copy link
Collaborator

@ericbuckley ericbuckley commented Oct 22, 2024

Description

Setting up the project to emit structured (JSON) logs in production so its easier to index and query in Splunk. Also adding a request correlation id to each request, so we can group together different logging messages.

Related Issues

closes #84

Additional Notes

  • adding new default logging configurations for development and production (the latter includes correlation ids and outputs logs as JSON)
  • adding the LOG_CONFIG env variable for selecting the logging configuration to use
  • adding middleware to append a correlation id to the request (this is so we can group logs together based on the same request) and another for writing a custom access log
  • removing the recordlinker.linkage module, as its no longer being used

<--------------------- REMOVE THE LINES BELOW BEFORE MERGING --------------------->

Checklist

Please review and complete the following checklist before submitting your pull request:

  • I have ensured that the pull request is of a manageable size, allowing it to be reviewed within a single session.
  • I have reviewed my changes to ensure they are clear, concise, and well-documented.
  • I have updated the documentation, if applicable.
  • I have added or updated test cases to cover my changes, if applicable.
  • I have minimized the number of reviewers to include only those essential for the review.

Checklist for Reviewers

Please review and complete the following checklist during the review process:

  • The code follows best practices and conventions.
  • The changes implement the desired functionality or fix the reported issue.
  • The tests cover the new changes and pass successfully.
  • Any potential edge cases or error scenarios have been considered.

@ericbuckley ericbuckley self-assigned this Oct 22, 2024
@ericbuckley ericbuckley changed the title Feature/84 structlog structured logging Oct 22, 2024
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.24%. Comparing base (c85f555) to head (faa8aef).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   93.51%   94.24%   +0.73%     
==========================================
  Files          19       21       +2     
  Lines         971     1025      +54     
==========================================
+ Hits          908      966      +58     
+ Misses         63       59       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ericbuckley ericbuckley marked this pull request as ready for review October 22, 2024 23:33
cbrinson-rise8
cbrinson-rise8 previously approved these changes Oct 25, 2024
Copy link
Collaborator

@cbrinson-rise8 cbrinson-rise8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

alhayward
alhayward previously approved these changes Oct 25, 2024
Copy link
Collaborator

@alhayward alhayward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some questions, LGTM. Is there an example of what this log will look like?

Dockerfile Show resolved Hide resolved
scripts/open_pulls.sh Show resolved Hide resolved
src/recordlinker/config.py Show resolved Hide resolved
@ericbuckley ericbuckley dismissed stale reviews from alhayward and cbrinson-rise8 via faa8aef October 25, 2024 20:07
@ericbuckley ericbuckley merged commit 0000ec5 into main Oct 25, 2024
10 checks passed
@ericbuckley ericbuckley deleted the feature/84-structlog branch October 25, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure structure logging framework
3 participants