| 7 | |
| 8 | My logging configuration is as follow: |
| 9 | |
| 10 | |
| 11 | {{{ |
| 12 | LOGGING = { |
| 13 | 'version': 1, # the dictConfig format version |
| 14 | 'disable_existing_loggers': False, # retain the default loggers |
| 15 | |
| 16 | 'handlers': { |
| 17 | 'rotatingFile': { |
| 18 | 'level': LOG_LEVEL, |
| 19 | 'class': 'logging.handlers.RotatingFileHandler', |
| 20 | 'formatter': 'verbose', |
| 21 | 'maxBytes': LOG_MAX_SIZE, |
| 22 | 'backupCount': LOG_NUMBER_OF_FILES, |
| 23 | 'filename': LOG_LOCATION, |
| 24 | } |
| 25 | }, |
| 26 | 'loggers': { |
| 27 | # '': { |
| 28 | # 'handlers': ['rotatingFile'], |
| 29 | # 'level': LOG_LEVEL, |
| 30 | # }, |
| 31 | 'root': { |
| 32 | 'handlers': ['rotatingFile'], |
| 33 | 'level': LOG_LEVEL, |
| 34 | }, |
| 35 | |
| 36 | }, |
| 37 | 'formatters': { |
| 38 | 'verbose': { |
| 39 | 'format': '{asctime} {levelname} {name} {module} {process:d} {thread:d} {message}', |
| 40 | 'style': '{', |
| 41 | }, |
| 42 | }, |
| 43 | }}} |