Skip to main content

No project description provided

Project description

logdriver

Run a socket server for application logging. Implemented as a CLI. Receives pickled LogRecord objects over a socket, buffers them, and handles them according to application requirements.

Supported Python versions

Installation

pip install logdriver

Example

Start logdriver on the command-line using default options. This will start the socket server listening on localhost on port 9079. It will use a StreamLogger to log all the LogRecords it receives to stdout, and set the logging level to WARNING.

$ logdriver
Started logdriver logging socket server
Listening for logs on localhost:9079
Press CTRL+C to quit
Starting TCP server

In your Python application, configure your logger to use a SocketHandler:

import logging
from logging.handlers import SocketHandler
handler = SocketHandler("localhost", 9079)
logger = logging.getLogger(__name__)
logger.addHandler(handler)

logger.warning("Hello, world!")

You should see the log getting printed by the socket server.

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

logdriver-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

logdriver-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file logdriver-0.1.0.tar.gz.

File metadata

  • Download URL: logdriver-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for logdriver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef817217f803df1675412206bd1b646a9c7397a13af4767984bcaaa8c712f54e
MD5 4abe0444d2bed61958068fd26b39ebab
BLAKE2b-256 a647090872e6e5f95c0a20dea864db43a4cad3c7c1589cc725f57a87d811cbd7

See more details on using hashes here.

Provenance

File details

Details for the file logdriver-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: logdriver-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for logdriver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d76e0a9996b408b5167a6bffd533307cdae08045e831c3fa5963517ae2fcc0dc
MD5 64f1569b00d419e9eda30f6a317438cd
BLAKE2b-256 44490af89feb6fb60ab67ff2d559bae0def437535354880d8c54427a9c3b1e5c

See more details on using hashes here.

Provenance

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