Merge pull request #335 from Phlogi/add-logging-info-to-example

enh(config): add logging configuration to .env.example
This commit is contained in:
Spotizerr
2025-08-28 06:53:55 -06:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -11,6 +11,7 @@
HOST=0.0.0.0
# Redis connection (external or internal).
# Host name 'redis' works with docker-compose.yml setup
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
@@ -56,4 +57,9 @@ GOOGLE_CLIENT_SECRET=
# GitHub SSO (get from GitHub Developer Settings)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_CLIENT_SECRET=
# Log level for application logging.
# Possible values: debug, info, warning, error, critical
# Set to 'info' or 'warning' for general use. Use 'debug' for troubleshooting.
LOG_LEVEL=info

2
app.py
View File

@@ -16,7 +16,7 @@ from dotenv import load_dotenv
load_dotenv()
# Parse log level from environment as early as possible, default to INFO for visibility
log_level_str = os.getenv("LOG_LEVEL", "WARNING").upper()
log_level_str = os.getenv("LOG_LEVEL", "INFO").upper()
log_level = getattr(logging, log_level_str, logging.INFO)
# Set up a very basic logging config immediately, so early logs (including import/migration errors) are visible