Skip to content

Commit

Permalink
Added logging config (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
de-code authored Dec 16, 2024
1 parent eddb245 commit ad44d11
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ RUN if [ "${install_dev}" = "y" ]; then \

COPY spacy_keyword_extraction_api ./spacy_keyword_extraction_api
COPY static ./static
COPY tests ./tests
COPY config ./config

COPY tests ./tests
COPY .flake8 .pylintrc ./

CMD ["python3", "-m", "uvicorn", "spacy_keyword_extraction_api.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]
CMD ["python3", "-m", "uvicorn", "spacy_keyword_extraction_api.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000", "--log-config=config/logging.yaml"]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ dev-start:
--reload \
--factory \
--host 127.0.0.1 \
--port 8000
--port 8000 \
--log-config=config/logging.yaml


build:
Expand Down
22 changes: 22 additions & 0 deletions config/logging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 1
disable_existing_loggers: false

formatters:
standard:
format: "%(asctime)s - %(levelname)s - %(message)s"

handlers:
console:
class: logging.StreamHandler
formatter: standard
stream: ext://sys.stdout

loggers:
uvicorn:
error:
propagate: true

root:
level: INFO
handlers: [console]
propagate: no

0 comments on commit ad44d11

Please sign in to comment.