Skip to main content

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.

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",
            "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

FOSSA Status

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

epylog-0.1.28.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

epylog-0.1.28-py2.py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 2 Python 3

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