Skip to content

Commit

Permalink
fix: continue work if log file path not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Gray-Advantage committed Jun 12, 2024
1 parent 4641651 commit 7d8d3bd
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions datanar/datanar/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,29 @@

NOT_TESTING = "test" not in sys.argv

LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"verbose": {
"format": "{levelname}\n{asctime}\n>>> {message}\n",
"style": "{",
if "None" != config("DJANGO_LOG_FILE_PATH", default="None", cast=str):
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"verbose": {
"format": "{levelname}\n{asctime}\n>>> {message}\n",
"style": "{",
},
},
},
"handlers": {
"file": {
"handlers": {
"file": {
"level": "WARNING",
"class": "logging.FileHandler",
"filename": config("DJANGO_LOG_FILE_PATH", cast=str),
"formatter": "verbose",
},
},
"root": {
"handlers": ["file"],
"level": "WARNING",
"class": "logging.FileHandler",
"filename": config("DJANGO_LOG_FILE_PATH", cast=str),
"formatter": "verbose",
},
},
"root": {
"handlers": ["file"],
"level": "WARNING",
},
}
}

ALLOWED_HOSTS = config(
"DJANGO_ALLOWED_HOSTS",
Expand Down

0 comments on commit 7d8d3bd

Please sign in to comment.