Skip to main content

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.

build status PyPi status FOSSA Status

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 fill rules array with logger names (use * wildcard if you want) and set which targets loggers can use:

    {
      "targets": [
          {
            "name": "fl",
            "type":  "file",
            "filename": "/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_*",
            "min-level": "info",
            "write-to": "fl, gl",
            "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
          },
          {  
            "name": "*",
             "min-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

Configuration reference

logging.cfg is a simple JSON object that descxribes all sources that you planning to use and associates loggers with this sources.

Targets

Tagrets are sources where can you send your logs.

...
    {
        "name": "fl",
        "type":  "file",
        ...
    }
...
Field Description
name Unique name of target
type Target type. Now availible file, watch-file, syslog, http and graylog target types
other fields Other fields associated with specific target e.g. filename, host, facility, etc.

Rules

Rules are patterns for associating user loggers with specific configuration.

...
    {  
      "name": "my_test_*",
      "min-level": "info",
      "write-to": "fl, gl",
      "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
    }
...
Field Description
name Unique name(s) of logger given by getLogger method. Use * wildcard for applying same settings for group of loggers
min-level Minimum logging level
write-to Target names splitted by comma without whitespases that will be asociated with this logger(s)
format Log line format

License

FOSSA Status

Metadata

Release files for epylog 0.1.33

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for epylog 0.1.33
File Size Uploaded Provenance Actions
epylog-0.1.33.tar.gz 5.4 kB Without provenance Details for epylog-0.1.33.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for epylog 0.1.33
File Interpreter ABI Platform Actions
epylog-0.1.33-py2.py3-none-any.whl Python 2, Python 3 none any Details for epylog-0.1.33-py2.py3-none-any.whl

Total release size: 11.0 kB

Release files / epylog-0.1.33.tar.gz

Download URL epylog-0.1.33.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fdba779ac3aa1923f5f8415ca91f735dc69e2bf60f283eba90f4fb90d77e9a04
BLAKE2b-256 checksum
How to use checksums
78f2f584130699783043785d80cd9a90ac674e7b7b71edbe8e8f55e931e50a2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

Release files / epylog-0.1.33-py2.py3-none-any.whl

Download URL epylog-0.1.33-py2.py3-none-any.whl
Size 5.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
efd7dfdbc31e227b11a3490da9358814724febc267665144f905b4fedc013389
BLAKE2b-256 checksum
How to use checksums
1143e4247031d233a41bd123141ab45c596ee16f74ccf1126d1fd7f1b91b4c5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

Security for epylog 0.1.33

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page