Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:
volumes:
- ${HOST_MEDIA_ROOT}:/data/cncnet_silo # django will save user-uploaded files here. MEDIA_ROOT
- ${HOST_STATIC_ROOT}:/data/cncnet_static # django will gather static files here. STATIC_ROOT
- ./docker/data/kirovy/logs:/var/log/kirovy # Log files
env_file:
- .env
depends_on:
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ COPY web_entry_point.sh /cncnet-map-api
RUN chmod +x /cncnet-map-api/web_entry_point.sh

RUN pip install --upgrade pip
RUN mkdir -p "/var/log/kirovy/json/"
RUN mkdir -p "/var/log/kirovy/flat/"

FROM base AS dev
RUN pip install -r ./requirements-dev.txt
Expand Down
20 changes: 18 additions & 2 deletions kirovy/settings/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from kirovy.settings import settings_constants
from kirovy.utils import file_utils
from kirovy.utils.file_utils import ByteSized
from kirovy.utils.settings_utils import (
get_env_var,
secret_key_validator,
Expand Down Expand Up @@ -266,15 +267,30 @@
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "plain_console",
},
"json_file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/kirovy/json/kirovy_json.log",
"maxBytes": ByteSized(mega=10).total_bytes,
"backupCount": 50,
"formatter": "json_formatter",
},
"flat_line_file": {
"class": "logging.handlers.RotatingFileHandler",
"filename": "/var/log/kirovy/flat/kirovy_flat.log",
"maxBytes": ByteSized(mega=10).total_bytes,
"backupCount": 50,
"formatter": "key_value",
},
},
"loggers": {
"kirovy": {
"handlers": ["console"],
"handlers": ["console", "flat_line_file"],
"level": LOG_LEVEL,
},
"django_structlog": {
"handlers": ["console"],
"handlers": ["console", "flat_line_file"],
"level": LOG_LEVEL,
},
},
Expand Down