spaceport/ldapserver/log.py

48 lines
1.0 KiB
Python
Raw Normal View History

import logging
import logging.config
2020-11-04 00:39:07 +00:00
LOG_DICT = {
'version': 1,
2020-11-04 00:39:07 +00:00
'formatters': {
'default': {
'format': '[%(asctime)s] [%(process)d] [%(levelname)7s] %(message)s',
},
},
'handlers': {
'wsgi': {
'class': 'logging.StreamHandler',
'stream': 'ext://flask.logging.wsgi_errors_stream',
'formatter': 'default'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'default'
},
'null': {
'level': 'DEBUG',
'class': 'logging.NullHandler',
'formatter': 'default'
},
},
'loggers': {
'gunicorn': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': False,
},
},
'root': {
'level': 'INFO',
'handlers': ['wsgi']
}
2020-11-04 00:39:07 +00:00
}
2020-11-04 00:39:07 +00:00
logging.config.dictConfig(LOG_DICT)
logger = logging.getLogger(__name__)
logger.info('Logging enabled.')
2020-11-04 00:39:07 +00:00
from logging_tree import printout
printout()