Skip to main content

Provides concurrent rotating file handler for posix-compatible OSes.

Project description

Provides concurrent rotating file handler for posix-compatible OSes.

By default multiprocessing.Lock is used. If you fork from one process that configures logger this case is preferred because of speed. If you have many undependantly started processes you should use instance of ploghandler.Lockf class. The Lockf class uses fcntl.lockf call described in man 3 lockf. Optinally ploghandler.Flock (man 2 flock) can be used.

Example:

import logging

from ploghandler import PLogHandler, Lockf

log = logging.getLogger("test")
handler = PLogHandler(
    "/var/log/test.debug.log",
    maxBytes=1024 * 1024,
    backupCount=5,
    rotlock=Lockf("/var/log/test.debug.lock"))

log.addHandler(handler)
log.setLevel(logging.DEBUG)

log.debug("test message")

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

ploghandler-0.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file ploghandler-0.2.tar.gz.

File metadata

  • Download URL: ploghandler-0.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ploghandler-0.2.tar.gz
Algorithm Hash digest
SHA256 d938bdf59f22c6664d38c3fc3086a75180aeaf2258ba4a767519b6d84514ce42
MD5 d4df9f99fcd654b6ed316dc73aa4ffb5
BLAKE2b-256 41d4684c0abf05b08112b666a927db8b4b907a91d5a38990a5c0f529578b4f06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page