First install Oohlalog from pypi
- pip install Oohlalog
Next initialize the custom logger into your api:
import logging
from oohlalog import logger
logs = logging.getLogger('test')
logs.addHandler(logger.OohLaLogHandler('API_KEY'))
import logging
from py3 import logger
logs = logging.getLogger('test')
logs.addHandler(logger.OohLaLogHandler('API_KEY'))
Here are some sample log calls (same as any logging you already have) that will be forwarded to Oohlalog
logs.info('test info')
logs.debug('test debug')
logs.warning('test warning')
logs.error('test error')
logs.critical('test critical')
now go check Oohlalog for the logs
OohLaLogHandler(apiKey, threshold=100, timeout=5, formatter=None)
Required
- apiKey = OohLaLog Api Key
Optional
- threshold = number of logs before sending to OohLaLog
- timeout = number of seconds to keep logs before sending to OohLaLog (overrides the threshold)
- formatter = logging.Formatter (http://docs.python.org/2/library/logging.html#logging.Formatter) that overrides the default detail string sent to OohLaLog