|
47 | 47 | 'file': { |
48 | 48 | 'encoding': 'utf8', |
49 | 49 | 'level': 'DEBUG', |
50 | | - 'class': 'logging.handlers.RotatingFileHandler', |
51 | | - 'maxBytes': 1024 * 1024 * 100, |
| 50 | + 'class': 'common.utils.logger.DailyTimedRotatingFileHandler', |
| 51 | + 'when': 'midnight', |
| 52 | + 'interval': 1, |
52 | 53 | 'backupCount': 7, |
53 | 54 | 'formatter': 'main', |
54 | 55 | 'filename': MAX_KB_LOG_FILE, |
55 | 56 | }, |
56 | 57 | 'drf_exception': { |
57 | 58 | 'encoding': 'utf8', |
58 | 59 | 'level': 'DEBUG', |
59 | | - 'class': 'logging.handlers.RotatingFileHandler', |
| 60 | + 'class': 'common.utils.logger.DailyTimedRotatingFileHandler', |
60 | 61 | 'formatter': 'exception', |
61 | | - 'maxBytes': 1024 * 1024 * 100, |
| 62 | + 'when': 'midnight', |
| 63 | + 'interval': 1, |
62 | 64 | 'backupCount': 7, |
63 | 65 | 'filename': DRF_EXCEPTION_LOG_FILE, |
64 | 66 | }, |
65 | 67 | 'unexpected_exception': { |
66 | 68 | 'encoding': 'utf8', |
67 | 69 | 'level': 'DEBUG', |
68 | | - 'class': 'logging.handlers.RotatingFileHandler', |
69 | | - 'formatter': 'exception', |
70 | | - 'maxBytes': 1024 * 1024 * 100, |
| 70 | + 'class': 'common.utils.logger.DailyTimedRotatingFileHandler', |
| 71 | + 'when': 'midnight', |
| 72 | + 'interval': 1, |
71 | 73 | 'backupCount': 7, |
| 74 | + 'formatter': 'exception', |
72 | 75 | 'filename': UNEXPECTED_EXCEPTION_LOG_FILE, |
73 | 76 | }, |
74 | 77 | 'syslog': { |
|
103 | 106 | 'level': LOG_LEVEL, |
104 | 107 | 'propagate': False, |
105 | 108 | }, |
106 | | - 'max_kb_error': { |
107 | | - 'handlers': ['console', 'unexpected_exception'], |
108 | | - 'level': LOG_LEVEL, |
109 | | - 'propagate': False, |
110 | | - }, |
111 | 109 | 'max_kb': { |
112 | 110 | 'handlers': ['console', 'file'], |
113 | 111 | 'level': LOG_LEVEL, |
|
0 commit comments