Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

splunk_handler and logbook

11 views
Skip to first unread message

jvar...@quixey.com

unread,
Feb 26, 2015, 2:59:26 AM2/26/15
to

Hi,
I am tring to use splunk(splunk_handler), my question is "Is there any way to integrate logbook with splunk_handler".


The examples of splunk_handler uses python's logging module.

Thanks

jvar...@quixey.com

unread,
Feb 26, 2015, 2:38:04 PM2/26/15
to
I got the solution,
Use RedirectLoggingHandler, to redirect the logs to logbook,

from logging import getLogger
mylog = getLogger('My Log')
from splunk_handler import SplunkHandler

splunk = SplunkHandler(
... host='',
... port='',
... username='',
... password='',
... index='',
... verify=,
... source=""
... )
from logbook.compat import RedirectLoggingHandler
mylog.addHandler(RedirectLoggingHandler())
mylog.addHandler(splunk)

......
0 new messages