Add Logstash file
This commit is contained in:
parent
edc5f85ba6
commit
152bc08970
|
@ -0,0 +1,19 @@
|
|||
import logstash
|
||||
import logging
|
||||
|
||||
from json import dumps, loads
|
||||
import main
|
||||
from utils.logging.log import *
|
||||
|
||||
logger = None
|
||||
def init_logstash():
|
||||
global logger
|
||||
logger = logging.getLogger('ingest')
|
||||
logger.setLevel(logging.INFO)
|
||||
logger.addHandler(logstash.TCPLogstashHandler(main.config["Logstash"]["Host"], int(main.config["Logstash"]["Port"]), version=1))
|
||||
|
||||
def sendLogstashNotification(text):
|
||||
if not logger == None:
|
||||
logger.info(dumps(text))
|
||||
return True
|
||||
return False
|
Loading…
Reference in New Issue