Commit 571557fd authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

Switch console datetime format to be more human friendly

parent 99d398dd
......@@ -227,7 +227,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -211,7 +211,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -519,7 +519,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -124,7 +124,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -248,7 +248,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -365,7 +365,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -124,7 +124,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -162,7 +162,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(args.config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -311,7 +311,10 @@ def main():
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(config['general']['console_format'])
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
......
......@@ -25,5 +25,5 @@ general:
log_facility: local5
data_dir: /var/tmp
log_format: 'level=%(levelname)s,message=%(message)s,entity=%(entity)s'
log_date_format: '%Y-%m-%DT%H:%M:%s%z'
date_format: '%Y-%m-%DT%H:%M:%s%z'
console_format: '[%(asctime)s][%(levelname)s]:%(message)s'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment