blob: 041860407b11fdcb38f23b10edafb5c3a34eb3c8 [file] [log] [blame]
Dennis Dmitrieve56c8b92017-06-16 01:53:16 +03001import os
2import time
3import logging.config
4
5
6LOGGER_SETTINGS = {
7 'version': 1,
8 'disable_existing_loggers': False,
9 'loggers': {
10 'reclass_tools': {
11 'level': 'DEBUG',
12 'handlers': ['console_output'],
13 },
14 'paramiko': {'level': 'WARNING'},
15 'iso8601': {'level': 'WARNING'},
16 'keystoneauth': {'level': 'WARNING'},
17 },
18 'handlers': {
19 'console_output': {
20 'class': 'logging.StreamHandler',
21 'level': 'INFO',
22 'formatter': 'default',
23 'stream': 'ext://sys.stdout',
24 },
25 },
26 'formatters': {
27 'default': {
28 'format': '%(asctime)s - %(levelname)s - %(filename)s:'
29 '%(lineno)d -- %(message)s',
30 'datefmt': '%Y-%m-%d %H:%M:%S',
31 },
32 },
33}
34
35logging.config.dictConfig(LOGGER_SETTINGS)
36# set logging timezone to GMT
37logging.Formatter.converter = time.gmtime
38logger = logging.getLogger(__name__)