Resolve "Fastapi logging setup"
Closes #6 (closed)
Merge request reports
Activity
Filter activity
assigned to @ee345
added 16 commits
- 97f976cb...81e0a665 - 6 earlier commits
- 4fda101c - fix: correct err in readme
- 0d08727c - chore: add pre-commit checks missing from boilerplates
- 2bb23bff - chore: run updated pre-commit fixes on existing files
- 6000fe2a - chore: run tests that need no extras installed sperately via tox
- 80fee865 - chore: omit test and tooling files from test coverage
- 80d78e68 - feat: default gunicorn logging conf
- 243ca0aa - fix: remove unnecessary poe cmd
- ac59567e - fix: run black across all files
- 0d49b6d2 - fix: correct readme following rebase
- 6b28d15b - fix: yield log_level env var after test
Toggle commit listadded 1 commit
- 303c25ae - feat(ucam_observe): add fastapi logger and update logging configurations
I created a separate branch to test these changes at this link. It installs this package via git from the current branch and make logs using the get_fastapi_logger.
Edited by E. Evstafievadded 1 commit
- 5c569f06 - feat(docs): init changelog and update version
- Resolved by E. Evstafiev
- ucam_observe/fastapi.py 0 → 100644
1 import structlog 2 3 from .gunicorn_conf import configure_logging 4 5 configure_logging() changed this line in version 6 of the diff
The current logging setup does indeed function as intended, as demonstrated in this branch.
Or you meant about decoupling the common logging setup from the gunicorn-specific module, something like this:
import abc import structlog class LoggingConfigurator(abc.ABC): @abc.abstractmethod def configure(self): pass ... class GunicornLoggingConfigurator(LoggingConfigurator): def configure(self): # Gunicorn-specific logging configuration ... class FastAPILoggingConfigurator(LoggingConfigurator): def configure(self): # FastAPI-specific logging configuration ... class LoggingConfigurationFactory: @staticmethod def get_configurator(environment: str) -> LoggingConfigurator: if environment == "gunicorn": return GunicornLoggingConfigurator() elif environment == "fastapi": return FastAPILoggingConfigurator() else: raise ValueError("Unsupported environment for logging configuration") ... configurator = LoggingConfigurationFactory.get_configurator("fastapi") configurator.configure()
- Resolved by E. Evstafiev
added 14 commits
-
7db80ac7...7bc19be2 - 13 commits from branch
main
- 711d91b9 - Merge branch 'main' into '6-add-fastapi-logging-setup'
-
7db80ac7...7bc19be2 - 13 commits from branch
requested review from @ee345
Please register or sign in to reply