Merge pull request #335 from Phlogi/add-logging-info-to-example
enh(config): add logging configuration to .env.example
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
HOST=0.0.0.0
|
HOST=0.0.0.0
|
||||||
|
|
||||||
# Redis connection (external or internal).
|
# Redis connection (external or internal).
|
||||||
|
# Host name 'redis' works with docker-compose.yml setup
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
REDIS_DB=0
|
REDIS_DB=0
|
||||||
@@ -57,3 +58,8 @@ GOOGLE_CLIENT_SECRET=
|
|||||||
# GitHub SSO (get from GitHub Developer Settings)
|
# GitHub SSO (get from GitHub Developer Settings)
|
||||||
GITHUB_CLIENT_ID=
|
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
2
app.py
@@ -16,7 +16,7 @@ from dotenv import load_dotenv
|
|||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
# Parse log level from environment as early as possible, default to INFO for visibility
|
# 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)
|
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
|
# Set up a very basic logging config immediately, so early logs (including import/migration errors) are visible
|
||||||
|
|||||||
Reference in New Issue
Block a user