Expose LOG_MAX_AGE #55

Merged
sixsmith merged 3 commits from sixsmith/traefik:v3-log-max-age into master 2025-08-28 18:05:28 +00:00
4 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ LETS_ENCRYPT_EMAIL=certs@example.com
# DASHBOARD_ENABLED=true
# WARN, INFO etc.
LOG_LEVEL=WARN
LOG_MAX_AGE=1
# This is here so later lines can extend it; you likely don't wanna edit
COMPOSE_FILE="compose.yml"

View File

@ -1,3 +1,3 @@
export TRAEFIK_YML_VERSION=v23
export TRAEFIK_YML_VERSION=v24
export FILE_PROVIDER_YML_VERSION=v10
export ENTRYPOINT_VERSION=v4

View File

@ -27,6 +27,7 @@ services:
environment:
- DASHBOARD_ENABLED
- LOG_LEVEL
- ${LOG_MAX_AGE:-0}
healthcheck:
test: ["CMD", "traefik", "healthcheck"]
interval: 30s

View File

@ -4,6 +4,7 @@ core:
log:
level: {{ env "LOG_LEVEL" }}
maxAge: {{ env "LOG_MAX_AGE" }}
decentral1se marked this conversation as resolved
Review

Oh sorry, this is not exactly compatible with new upgrades that won't make use of this env var? E.g. if they don't add a LOG_MAX_AGE to their .env (there is a warning from abra buy yanno...) then they might have a broken config? I'm not sure. One way to avoid this is to use the ${LOG_MAX_AGE:-1} bash default value trick in the compose.yml inclusion of the env var (see other recipes for examples)? However, then you need to make sure this default is the standard default and doesn't have behaviour changing effects for other operators.

Oh sorry, this is not exactly compatible with new upgrades that won't make use of this env var? E.g. if they don't add a `LOG_MAX_AGE` to their `.env` (there is a warning from `abra` buy yanno...) then they might have a broken config? I'm not sure. One way to avoid this is to use the `${LOG_MAX_AGE:-1}` bash default value trick in the `compose.yml` inclusion of the env var (see other recipes for examples)? However, then you need to make sure this default is the standard default and doesn't have behaviour changing effects for other operators.
providers:
swarm: