Skip to content

Commit

Permalink
Merge branch 'master' of github.com:l3p-cv/lost
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeger-j committed Feb 8, 2023
2 parents edd9b5a + 96091aa commit d47cc9a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion backend/lost/logic/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from lostconfig import LOSTConfig

def get_file_logger(name, file_path):
logger = logging.getLogger(name)
Expand All @@ -20,4 +21,14 @@ def get_stream_logger(name, stream):
sh.setFormatter(formatter)
logger.addHandler(sh)
logger.setLevel(logging.DEBUG)
return logger
return logger

def get_graylog_logger(name):
logger = logging.getLogger(name)
if LOSTConfig().use_graylog:
from pygelf import GelfUdpHandler
logger.addHandler(GelfUdpHandler(host='graylog', port=12201, _type=name, include_extra_fields=True))

logger.setLevel(logging.DEBUG)
return logger

0 comments on commit d47cc9a

Please sign in to comment.