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

[LLSC-51] Fix logging within backend #14

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mslwang
Copy link
Collaborator

@mslwang mslwang commented Dec 1, 2024

Notion ticket link

Add startup Logs (Fix logging) for backend

Implementation description

  • We were having issues troubleshooting where some people may have startup issues, since errors weren't being emitted to the console (through standard error). After deep diving, we realized that the alembic.ini config was taking control over logging configurations and suppressing other loggers. Given that going without the alembic.ini config doesn't seem viable at the moment, I've stuck to basing all loggers in the API off of one sublogger, and using a function to create child loggers for more context.

Steps to test

  1. Run pdm run dev
  2. Add a new logger using the instructions in the README to another service, ie.
    To add a logger to a new service or file, use the LOGGER_NAME function in app/utilities/constants.py
from app.utilities.constants import LOGGER_NAME

log = logging.getLogger(LOGGER_NAME("my_service"))

What should reviewers focus on?

  • Whether logging works

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@mslwang mslwang requested review from Mayank808 and mmiqball December 1, 2024 04:36
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.

2 participants