Skip to main content

Remote Logger

Project description

https://img.shields.io/badge/License-GPL%20v3-blue.svg https://badge.fury.io/py/remote-logger.svg https://img.shields.io/travis/HenleyKuang/remote-logger.svg

Remote Logger

Installation

pip install remote-logger

Examples

from remote_logger.remote_logger_handler import RemoteLoggerHandler
from remote_logger.util.definitions import SENTRY

client_type = SENTRY
dummy_group_id = 99
dsn = https://<key>@sentry.io/<project>
sentry_handler = RemoteLoggerHandler(client_type,
                                     dsn=dsn)
sentry_handler.setLevel(logging.ERROR)
LOGGER.addHandler(sentry_handler)
LOGGER.error("Test Message", extra={
    "group_id": dummy_group_id,
    "primary_metadata": {
        "pkey1": "pvalue1",
        "pkey2": "pvalue2",
        "pkey3": "pvalue3",
    },
    "secondary_metadata": {
        "skey1": "svalue1",
        "skey2": "svalue2",
        "skey3": "svalue3",
    }
})

Project details


Download files

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

Source Distribution

remote-logger-0.2.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

remote_logger-0.2.0-py3-none-any.whl (18.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page