Skip to main content

Send python logs to RocketChat server.

Project description

rocketloghandler

Send your Python logs to RocketChat.

Implements a custom handler for the Python logging module.

For a full working example see rocketlog_test.py.

Using Logging in multiple modules

Ensure there is a hierarchical structure in the logger name separated by dots. The name is set when calling logging.getLogger.

Usage example

import logging

from rocketloghandler.rocketloghandler import RocketLogHandler

rocketHandler = RocketLog(USER_ID, TOKEN, SERVER, CHANNEL_NAME, USER_ALIAS)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
log = logging.getLogger(__name__)
rocketHandler.setFormatter(formatter)
log.addHandler(rocketHandler)
log.warning("Never say no to the panda! Otherwise: https://www.youtube.com/watch?v=XYz3sl0LEA4")

Contributing

Feel free to contribute to this project. A contribution guide is available. Please add yourself to the list of contributors when you submit the pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rocketloghandler, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size rocketloghandler-0.1.1-py3-none-any.whl (3.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size rocketloghandler-0.1.1.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page