Created
July 30, 2023 08:55
-
-
Save Afeez1131/1d5608f286b527c1c844769130f646dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOG_DIR = os.path.join(BASE_DIR, 'logs') # the log dir | |
os.makedirs(LOG_DIR, exist_ok=True) # check to see if we have the directory, if not, create it. | |
LOGGING = { | |
"version": 1, | |
"disable_existing_loggers": False, | |
"formatters": { | |
"simple": { | |
"format": "%(levelname)s %(asctime)s %(message)s" | |
}, | |
"detailed": { | |
"format": "%(levelname)s %(asctime)s %(module)s %(message)s" | |
}, | |
}, | |
"handlers": { | |
"console": { | |
"class": "logging.StreamHandler", | |
"level": "INFO", | |
"formatter": "simple" | |
}, | |
"file": { | |
"class": "logging.FileHandler", | |
"level": "INFO", | |
"filename": os.path.join(LOG_DIR, 'logging.log'), | |
"formatter": "detailed", | |
}, | |
}, | |
"loggers": { | |
"django": { | |
"handlers": ["file"], | |
"level": "DEBUG", | |
}, | |
"account": { | |
"handlers": ["console", "file"], | |
"level": "INFO", | |
}, | |
"core": { | |
"handlers": ["console", "file"], | |
"level": "INFO" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment