X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FLogger.py;h=a48ac7d1b1f78809dfc574a160b925bf17db04ff;hb=HEAD;hp=ca85ac9f67d485a49fba4d7cd987ad0eafcc1c74;hpb=fdc1bf78189188df147a882721805e7ed5654459;p=plcapi.git diff --git a/PLC/Logger.py b/PLC/Logger.py index ca85ac9..a48ac7d 100644 --- a/PLC/Logger.py +++ b/PLC/Logger.py @@ -1,3 +1,5 @@ +# pylint: disable=c0103 + import logging import logging.config @@ -5,24 +7,22 @@ import logging.config # that goes into /var/log/plcapi.log plcapi_logging_config = { - 'version' : 1, - 'disable_existing_loggers' : True, - 'formatters': { - 'standard': { - 'format': '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(message)s', - 'datefmt': '%m-%d %H:%M:%S' - }, - 'shorter': { - 'format': '%(asctime)s %(levelname)s %(message)s', - 'datefmt': '%d %H:%M:%S' + 'version': 1, + # IMPORTANT: we may be imported by something else, like sfa, so: + 'disable_existing_loggers': False, + 'formatters': { + 'standard': { + 'datefmt': '%m-%d %H:%M:%S', + 'format': ('%(asctime)s %(levelname)s ' + '%(filename)s:%(lineno)d %(message)s'), }, }, 'handlers': { 'plcapi': { + 'filename': '/var/log/plcapi.log', 'level': 'INFO', 'class': 'logging.FileHandler', 'formatter': 'standard', - 'filename' : '/var/log/plcapi.log', }, }, 'loggers': {