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 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