Logging handler to send logs to your OpenSearch cluster with bulk SSL. Forked from https://github.com/logzio/logzio-python-handler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
497 B

import sys
import logging
def get_logger(debug):
return __get_logger(debug, __name__)
def get_stdout_logger(debug):
stdout_logger = __get_logger(debug, __name__ + '_stdout', logging.StreamHandler(sys.stdout))
stdout_logger.propagate = False
return stdout_logger
def __get_logger(debug, name, handler=None):
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG if debug else logging.INFO)
if handler:
logger.addHandler(handler)
return logger