Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Logging handler and CLI for

Project Description

# Python Sinklog
Logging handler and CLI for

## Install
$ pip install python-sinklog

## Usage
Obtain a log key from

### CLI
usage: sinklog [-h] --key KEY [--host HOST] [--port PORT] [--format FORMAT]
[--level {WARN,INFO,DEBUG,ERROR}] [--tee]

A simple logger for

positional arguments:
message messages to log

optional arguments:
-h, --help show this help message and exit
--key KEY, -k KEY log key
--host HOST, -H HOST Sinklog host
--port PORT, -P PORT Sinklog port
--format FORMAT, -F FORMAT
Python log format
Python log level
--tee, -t when reading from stdin, copy to stdout

example usage:

# log a message on the command line
$ sinklog -k <log key> "my log message"

# log from stdin
$ tail -f /var/log/myapp.log | sinklog -k <log key>

# usage in a pipeline
$ tail -f /var/log/myapp.log | sinklog -k <log key> --tee | grep foo

### Python
Any Python script or app:

import logging
from sinklog import SinklogHandler

sinklog = SinklogHandler(logkey="<log key>", transport="tls")
logger = logging.getLogger()

# Just use the logger as you would normally and log
# messages will be forwarded to your Sinklog stream."Hello Sinklog!")

### Django
Add `SinklogHandler` to your Django logging config:

'handlers': {
'sinklog': {
'level': "DEBUG",
'class': "sinklog.SinklogHandler",
'logkey': "<log key>",
'transport': "tls"
'loggers': {
'django.db.backends': {
'level': 'ERROR',
'handlers': ['sinklog'],
'propagate': False

### Flask
Add `SinklogHandler` to Flask's root app logger:

from sinklog import SinklogHandler

sinklog = SinklogHandler(logkey="<log key>", transport="tcp")

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(7.7 kB) Copy SHA256 Hash SHA256
Source None Jan 31, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting