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!')
Release files for tlssysloghandler 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tlssysloghandler-2.0.0.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tlssysloghandler-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / tlssysloghandler-2.0.0.tar.gz
| Download URL | tlssysloghandler-2.0.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee7ed78f858001f096b99e1f118b2c75cf9de65f4a92c9b6a05cca8a44bb98b7
|
|
BLAKE2b-256 checksum How to use checksums |
b3c0bedb495a9efd4941f3c1632d853868d8cd0455b8cc7d2607ff49c807c942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 19, 2025.
Transparency logRelease files / tlssysloghandler-2.0.0-py3-none-any.whl
| Download URL | tlssysloghandler-2.0.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4d3beffeb2cfc421f066f556b697a1ea74d42fda2d328f73fbebbdcb9b82c8c
|
|
BLAKE2b-256 checksum How to use checksums |
997f1d6692f594199d3111d4935487c218f2a46a9d779dfd5a3f7195c6cca0ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 19, 2025.
Transparency log