Skip to content

Instantly share code, notes, and snippets.

View finloop's full-sized avatar

Piotr Krawiec finloop

View GitHub Profile
@finloop
finloop / docker_output.py
Created June 22, 2022 17:42 — forked from oseme-techguy/docker_output.py
Docker Python logger output to stdout
import logging
from sys import stdout
# Define logger
logger = logging.getLogger('mylogger')
logger.setLevel(logging.DEBUG) # set logger level
logFormatter = logging.Formatter\
("%(name)-12s %(asctime)s %(levelname)-8s %(filename)s:%(funcName)s %(message)s")
consoleHandler = logging.StreamHandler(stdout) #set streamhandler to stdout