Skip to main content

exchange_log_handler

Log handler to send log via exchange

Dependencies

This library used ecederstrand/exchangelib to send exchange mail.

How to install:

pip install exchange_log_handler

Usage:

if __name__ == '__main__':
    import logging
    import logging.config
    logging.config.dictConfig({
        'version': 1,
        'disable_existing_loggers': False,
        'handlers': {
            'console': {
                'level': 'INFO',
                'class': 'logging.StreamHandler',
                'stream': 'ext://sys.stdout',
            },
            'email': {
                'level': 'ERROR',
                'class': 'exchange_log_handler.ExchangeHandler',
                'credentials': ('email_address', 'email_password'),
                'subject': lambda r: '{0}-{1}'.format(r.levelname, r.name),
                'toaddrs': 'recipient_email_address',
            },
        },
        'loggers': {
            '': {
                'handlers': [ 'console', 'email' ],
                'level': 'DEBUG',
                'propagate': True,
            },
        },
    })

    logger = logging.getLogger(__name__)
    try:
        raise ValueError('This is a test exception.')
    except Exception as e:
        logger.exception(e)

Metadata

Release files for exchange-log-handler 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exchange-log-handler 0.1.0
File Size Uploaded
exchange_log_handler-0.1.0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for exchange-log-handler 0.1.0
File Interpreter ABI Platform
exchange_log_handler-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / exchange_log_handler-0.1.0.tar.gz

Download URL exchange_log_handler-0.1.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7324c6f02a2a8f292109e142c8b0e985c8778606bf760266a383a3fad6046dc5
BLAKE2b-256 checksum
How to use checksums
c8e5cc8b589ffe72a6ab1f31896998d26b6a8e610693252eec522c2f53007509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9

Release files / exchange_log_handler-0.1.0-py3-none-any.whl

Download URL exchange_log_handler-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c59ca616fcac46d7281329c6a838c9ae205a81a45dd84d18bfe2e78302e6bcf3
BLAKE2b-256 checksum
How to use checksums
2f295b9fd441c2e9a59d32472a5f526476ab95c22a78484842702984ca184bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page