Just another one Python logging package.
Project description
EPYLOG
Logs are the first.
This is a simple wrapper to standard logging library for Python.
Epylog provides to send log data to different sources e.g. file, rsyslog, graylog, http, etc.
Use different loggers for different needs and manage it from one place.
Installation
pip install epylog
Usage
-
Move to project root directory and create
logging.cfg
file:cd /project/root touch logging.cfg
-
Fill configuration file with you logging settings. Push to
targets
array everything you want to send to. And fillrules
array with logger names (use*
wildcard if you want) and set which targets loggers can use:{ "targets": [ { "name": "fl", "type": "file", "filepath": "/var/log/my_log.log" }, { "name": "gl", "type": "graylog", "host": "localhost", "port": 12202, "facility": "test" }, { "name": "rsl", "type": "syslog", "address": "localhost", "facility": "test" } ], "rules": [ { "name": "my_test_*", "level": "info", "write-to": "fl, gl", "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s" }, { "name": "*", "level": "warning", "write-to": "rsl", "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s" } ] }
-
Finally call
getLogger
function to initialize your logger:from epylog import Logger # put some code here logger = Logger.getLogger('my_test_logger') logger.info('Hello from %s', logger.name)
-
Enjoy sending your logs everywhere
License
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
Built Distribution
File details
Details for the file epylog-0.1.31.tar.gz
.
File metadata
- Download URL: epylog-0.1.31.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 418d6fd46a43a0fa9678acbca17ae5889efbbce08d9d6eae457420bcc09e9b1a |
|
MD5 | 64c92cd88dc32a0edd126fb2b4f726c5 |
|
BLAKE2b-256 | 2ef44af289ed5b32683ef5899d3e849f6a81d548c86a8f5f94ff4f35d7038508 |
File details
Details for the file epylog-0.1.31-py2.py3-none-any.whl
.
File metadata
- Download URL: epylog-0.1.31-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c500a8ebb462985b0345bb74d05ba6741a03315a1cb1aeb48a2192bc32ddf92 |
|
MD5 | 92bcaaca1b3f7462152084fb5eaa7c71 |
|
BLAKE2b-256 | 29643f0dc46609605787cf835054270f26c0ae42c664b6f91222b48c3f0a61e3 |