Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readme to show logging to Loggly's Gen2 API #9

Open
wants to merge 2 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Update Readme to show logging to Loggly's Gen2 API

Loggly's new API for logging from HTTP/S endpoints can be used with the described workaround.
  • Loading branch information
eli-b committed Jan 12, 2015
commit b8fd98ebf22e8f503a20d64ec182f8245237fc85
@@ -20,7 +20,7 @@ Pypi: <http://pypi.python.org/pypi/Hoover>



##Using Hoover
##Using Hoover For Searching Loggly


Enter your credentials in hoover.LogglySession after importing:
@@ -35,6 +35,18 @@ Enter your credentials in hoover.LogglySession after importing:
i.search(q='apache2 error', starttime='NOW-2DAYS', format='csv')
i.search(q='json.priority:err', starttime='NOW-15MINUTES') #Defaults to json if format is left out

##Using Hoover For Logging to Loggly's New API

import logging
from hoover.handlers import LogglyHttpHandler
.
.
.
token_and_suffix = "{token}/tag/http'.format(token=YOUR_LOGGLY_TOKEN_FROM_SOURCE_SETUP)
loggly_handler = LogglyHttpHandler(token=token_and_suffix, proxy='logs-01.loggly.com')
logger = logging.getLogger('default')
logger.addHandler(loggly_handler)
logger.critical("This goes straight to my Loggly!")

##Search Properties

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.