forked from tmsf/factorialhr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
38 lines (35 loc) · 973 Bytes
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import logging.config
import os
BASE_PROJECT = os.path.abspath(os.path.dirname(__file__))
LOGGING_CONFIG = {
'version': 1,
'formatters': {
'standard': {
'format': '%(name)s - %(asctime)s - %(levelname)s - %(message)s'
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'formatter': 'standard',
'class': 'logging.StreamHandler'
},
'file': {
'level': 'DEBUG',
'formatter': 'standard',
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': os.path.join(BASE_PROJECT, 'logs', 'factorialclient.log'),
'interval': 1,
'when': 'W0',
'backupCount': 6
}
},
'loggers': {
'factorial.client': {
'handlers': ['console', 'file'],
'level': 'DEBUG',
'propagate': True
}
}
}
logging.config.dictConfig(LOGGING_CONFIG)