Skip to main content

Send log messages to sendinblue's transactional email service.

Project description

Description

This is a logging handler for Python's logging module to send log messages over sendinblue's transactional email service.

Installation

$ pip install sendinblue-logger

Usage

import sblue
import logging
import os

handler = sblue.LoggingHandler(
    level=logging.ERROR,
    api_key=os.getenv('SENDINBLUE_API_KEY'),
    from_email='sender-email@domain.com',
    to_email='recipient-email@domain.com',
)

logging.basicConfig(
    filename='/home/user/project/project.log', 
    encoding='utf-8', 
    level=logging.DEBUG, 
    format='%(asctime)s - %(levelname)s: %(message)s',
    handlers=(handler,)
)

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

sendinblue-logger-1.0.0.tar.gz (2.8 kB view hashes)

Uploaded source

Built Distribution

sendinblue_logger-1.0.0-py3-none-any.whl (3.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page