Skip to main content

SysLogHandler with TLS

Python logging.handler as a drop-in replacement for logging.SysLogHandler with support for sending syslog messages over TCP with TLS.

Installation

pip install tlssysloghandler

Usage

import logging
from tlssysloghandler import TLSSysLogHandler

logger = logging.getLogger()
logger.setLevel(logging.INFO)

# with default system certificate store
handler1 = TLSSysLogHandler(address=('secure-logging.example.com', 6514),
                            socktype=socket.SOCK_STREAM,
                            secure=True)
logger.addHandler(handler1)

# with custom certificates, via cafile/capath/cadata
# refer to https://docs.python.org/3/library/ssl.html#ssl.create_default_context
handler2 = TLSSysLogHandler(address=('secure-logging.example.com', 6514),
                            socktype=socket.SOCK_STREAM,
                            secure={cafile='/path/to/ca/file'})
logger.addHandler(handler2)

# with custom SSLContext (e.g. for mutual TLS authentication)
context = ssl.create_default_context(
    purpose=ssl.Purpose.SERVER_AUTH, cafile="/path/to/ca/file"
)
context.load_cert_chain(
    certfile="/path/to/client/cert.pem",
    keyfile="/path/to/client/priv.key",
)
handler3 = TLSSysLogHandler(address=('secure-logging.example.com', 6514),
                            socktype=socket.SOCK_STREAM,
                            secure=context)
logger.addHandler(handler3)

# or allow TLS without verification (not recommended)
handler4 = TLSSysLogHandler(address=('secure-logging.example.com', 6514),
                            socktype=socket.SOCK_STREAM,
                            secure="noverify")
logger.addHandler(handler4)

logger.info('Hello, World!')

Metadata

Release files for tlssysloghandler 2.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 tlssysloghandler 2.1.0
File Size Uploaded
tlssysloghandler-2.1.0.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tlssysloghandler 2.1.0
File Interpreter ABI Platform
tlssysloghandler-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / tlssysloghandler-2.1.0.tar.gz

Download URL tlssysloghandler-2.1.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3cb61b1304b9b73b1f2685cb7da818e2ca225d477ff59b9c0f26d994a45f3cd9
BLAKE2b-256 checksum
How to use checksums
d89aca5cc90318b2c8323056d8d4ca06d198549ba323bdc3313dc9a2d37e87c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / tlssysloghandler-2.1.0-py3-none-any.whl

Download URL tlssysloghandler-2.1.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3827678b636290d3a5581018f4b02ae7f7cbce7dfd09718909ca0cfa79cb00f1
BLAKE2b-256 checksum
How to use checksums
926e0ad28c5fbf23e50bcb1fbc0ddd686dd9caa937ca44c54b52c13eafc09d94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

1 release file

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