Fix duplicate logs.

- Specify a name for the logger as recommended by the logging
  documentation. However for strange reason requests logs are
  not anymore capture in the log file. This needs to be reviewed.
This commit is contained in:
Uggla 2016-01-03 22:59:47 +01:00
parent 4b2b4ad5c6
commit 3eed4813f0
3 changed files with 7 additions and 3 deletions

View File

@ -303,7 +303,6 @@ if __name__ == '__main__':
loglevel['tortilla'] = True
# Initialize logger according to command line parameters
logger = None
logger = redfish.config.initialize_logger(arguments['--debugfile'],
loglevel['console_logger_level'],
loglevel['file_logger_level'],

View File

@ -15,7 +15,7 @@ FILE_LOGGER_LEVEL = logging.DEBUG
def initialize_logger(REDFISH_LOGFILE,
CONSOLE_LOGGER_LEVEL,
FILE_LOGGER_LEVEL,
logger_name=""):
logger_name=None):
'''Initialize a global logger to track application behaviour
:param redfish_logfile: Log filename

View File

@ -160,9 +160,14 @@ class RedfishConnection(object):
verify_cert=True
):
"""Initialize a connection to a Redfish service."""
# Specify a name for the logger as recommended by the logging
# documentation. However for strange reason requests logs are not
# anymore capture in the log file.
# TODO : Check strange behavior about requests logs.
config.logger = config.initialize_logger(config.REDFISH_LOGFILE,
config.CONSOLE_LOGGER_LEVEL,
config.FILE_LOGGER_LEVEL)
config.FILE_LOGGER_LEVEL,
__name__)
config.logger.info("Initialize python-redfish")