Skip to content

Commit

Permalink
feat(api): uvicorn (#3050)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Jan 18, 2025
1 parent b2cf3ca commit e8cbcb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions keep/api/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,12 @@ def setup_logging():
logging.config.dictConfig(CONFIG)
uvicorn_error_logger = logging.getLogger("uvicorn.error")
uvicorn_error_logger.__class__ = CustomizedUvicornLogger

# ADJUST UVICORN ACCESS LOGGER
# https://github.com/benoitc/gunicorn/issues/2299
# https://github.com/benoitc/gunicorn/issues/2382
LOG_FMT = "%(asctime)s - %(otelTraceID)s - %(threadName)s - %(message)s"
logger = logging.getLogger("uvicorn.access")
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter(LOG_FMT))
logger.handlers = [handler]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keep"
version = "0.34.6"
version = "0.34.7"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
packages = [{include = "keep"}]
Expand Down

0 comments on commit e8cbcb3

Please sign in to comment.