Skip to main content

Watches your logging configuration file for change and applies them without requiring an application restart

Project description

Log Config Watcher

This library makes it easy to load a JSON formatted Python Logging configuration file and monitor the file for changes. If the configuration has changed, and is valid, it will automatically be applied and the changes will be reflect in your logging without restarting.

Getting Started

from log_config_watcher import LogConfigWatcher

log_watcher = LogConfigWatcher("config.json")
log_Watcher.start()

Options

The LogConfigWatcher class using the Python logging system to setup a basicConfig before attempting to load the config file. This way if there are any errors during the loading of the file they will be reported somewhere. You can customize the defaults using the following settings passed to the constructor.

  • default_level: int - A Python logging logging level, such as, DEBUG, INFO, WARNING, or ERROR
  • default_format: str - A Python logging format string
  • default_handler: logging.Handler - A Python logging Handler type, such as, StreamHandler, FileHandler, etc, etc
  • logger_name: str - defaults to LogWatcher when calling getLogger. Setting this allows you to use a custom logger

Development

This project uses Poetry as its project manager. The goal of this library is to have no external runtime dependencies. However, for development, the following are used:

  • pytest - For running tests
  • pre-commit - Pre-commit hooks to check formatting and lots of other things
    • PR will automatically run these check and fail if they don't pass

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

log_config_watcher-0.3.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

log_config_watcher-0.3.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file log_config_watcher-0.3.1.tar.gz.

File metadata

  • Download URL: log_config_watcher-0.3.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for log_config_watcher-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1ff15f89533063c330bd5dfd1534a2d8f590f439ea7609bf0da5c9542ddc70d7
MD5 ea11691e280b5c1aef9af486fe6fc946
BLAKE2b-256 3d1364afe52807288d9f78bae80a9b1d76f9defbb42bb7f096bf6df0397f8e35

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_config_watcher-0.3.1.tar.gz:

Publisher: publish.yml on RobertDeRose/log_config_watcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_config_watcher-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for log_config_watcher-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b82a491ce49aa5518aba736a8d5dd145a21b37f31d5d680a25dcfabf0655ec5c
MD5 23b98f00e8ae3fa6f3e79222634d9cdf
BLAKE2b-256 1eb363012873e73d618522502f925e74819549e4894882146e24618137fc3f97

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_config_watcher-0.3.1-py3-none-any.whl:

Publisher: publish.yml on RobertDeRose/log_config_watcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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