22 lines
525 B
Python
22 lines
525 B
Python
import logging
|
|
from logstash_formatter import LogstashFormatterV1
|
|
from statsd import StatsClient
|
|
from nameko_sentry import SentryReporter
|
|
|
|
|
|
def init_statsd(prefix=None, host=None, port=8125):
|
|
statsd = StatsClient(host, port, prefix=prefix)
|
|
return statsd
|
|
|
|
|
|
def init_logger():
|
|
logger = logging.getLogger()
|
|
handler = logging.StreamHandler()
|
|
formatter = LogstashFormatterV1()
|
|
handler.setFormatter(formatter)
|
|
logger.addHandler(handler)
|
|
return logger
|
|
|
|
|
|
def init_sentry():
|
|
return SentryReporter() |