add log level env variable

This commit is contained in:
maxid
2025-12-29 11:57:00 +01:00
parent 4cc4ff3629
commit 63a65c85bd
3 changed files with 36 additions and 29 deletions

View File

@@ -8,4 +8,10 @@ the console (stdout) by default, and to a json-formatted log file.
The location of the log file can be configured with the `LOG_FILE` environment variable. By default, the log file is
located at
`/app/config/media_manager.log`. When changing the log file location, ensure that the directory exists, is writable by the
MediaManager container and that it is a full path.
MediaManager container and that it is a full path.
With the `MEDIAMANAGER_LOG_LEVEL` environment variable, you can set the logging level. The available levels are:
- `DEBUG` - Detailed information, typically of interest only when diagnosing problems.
- `INFO` - The default level, for general operational entries about what's going on inside the application.
- `WARNING`
- `ERROR`

View File

@@ -34,6 +34,7 @@ services:
- MEDIAMANAGER_MISC__CORS_URLS=["http://localhost:5173"]
- DISABLE_FRONTEND_MOUNT=TRUE
- LOG_FILE=/dev/null
- MEDIAMANAGER_LOG_LEVEL=DEBUG
volumes:
#- ./web/build:/app/web/build # this is only needed to test built frontend when developing frontend
- ./res/images/:/data/images/
@@ -60,33 +61,33 @@ services:
# Additional services can be uncommented and configured as needed
# ----------------------------
# prowlarr:
# image: lscr.io/linuxserver/prowlarr:latest
# container_name: prowlarr
# environment:
# - PUID=1000
# - PGID=1000
# - TZ=Etc/UTC
# volumes:
# - ./res/prowlarr:/config
# restart: unless-stopped
# ports:
# - "9696:9696"
# qbittorrent:
# image: lscr.io/linuxserver/qbittorrent:latest
# container_name: qbittorrent
# environment:
# - TZ=Etc/UTC
# - WEBUI_PORT=8080
# - TORRENTING_PORT=6881
# ports:
# - 8080:8080
# - 6881:6881
# - 6881:6881/udp
# restart: unless-stopped
# volumes:
# - ./res/torrents:/download
# - ./res/qbittorrent:/config
prowlarr:
image: lscr.io/linuxserver/prowlarr:latest
container_name: prowlarr
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- ./res/prowlarr:/config
restart: unless-stopped
ports:
- "9696:9696"
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- TZ=Etc/UTC
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
ports:
- 8080:8080
- 6881:6881
- 6881:6881/udp
restart: unless-stopped
volumes:
- ./res/torrents:/download
- ./res/qbittorrent:/config
# transmission:
# image: lscr.io/linuxserver/transmission:latest
# container_name: transmission

View File

@@ -13,7 +13,7 @@ class ISOJsonFormatter(JsonFormatter):
return dt.isoformat(timespec="milliseconds").replace("+00:00", "Z")
LOG_LEVEL = logging.DEBUG
LOG_LEVEL = os.getenv("MEDIAMANAGER_LOG_LEVEL", "INFO").upper()
LOG_FILE = Path(os.getenv("LOG_FILE", "/app/config/media_manager.log"))
LOGGING_CONFIG = {
"version": 1,