I am trying to add a timestamp to my Python logging code.
I have the code:
logging.basicConfig(format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M')
log = logging.getLogger('Test_Service')
log.info(' Hello World')
But the output only shows:
INFO:Test_Service: Hello World
How can I get the formatter to work here so that I can include the timestamp?