Skip to content

Commit

Permalink
Merge pull request #3 from nationalarchives/logging-config
Browse files Browse the repository at this point in the history
Add logging config
  • Loading branch information
tm-kn authored Nov 26, 2024
2 parents 268b7b2 + a804ad6 commit 6c98b61
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,54 @@

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"


# Logging
# https://docs.djangoproject.com/en/stable/topics/logging/
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
# Send logs with at least INFO level to the console.
"console": {
"level": "INFO",
"class": "logging.StreamHandler",
"formatter": "verbose",
},
},
"formatters": {
"verbose": {
"format": "[%(asctime)s][%(process)d][%(levelname)s][%(name)s] %(message)s"
}
},
"root": {
"handlers": ["console"],
"level": "WARNING",
},
"loggers": {
"app": {
"handlers": ["console"],
"level": "INFO",
"propagate": False,
},
"config": {
"handlers": ["console"],
"level": "INFO",
"propagate": False,
},
"django.request": {
"handlers": ["console"],
"level": "WARNING",
"propagate": False,
},
"django.security": {
"handlers": ["console"],
"level": "WARNING",
"propagate": False,
},
},
}


# TNA Configuration

ENVIRONMENT: str = os.environ.get("ENVIRONMENT", "production")
Expand Down

0 comments on commit 6c98b61

Please sign in to comment.