Skip to content
Amazon Kinesis Firehose logging handler and utilities
Python
Branch: master
Clone or download
Pull request Compare This branch is even with marcy-terui:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
kflogs
.gitignore
LICENSE
README.md
register.py
setup.py
test.py

README.md

kflogs

Version

Description

Amazon Kinesis Firehose logging handler and utilities.

Requirements

  • Python2.7 or higher
  • pip

Installation

PyPI

pip install kflogs

Usage

Sample Code

import logging
import kflogs

logger = logging.getLogger('foo')
handler = kflogs.KinesisFirehoseHandler(stream_name='bar')
handler.setFormatter(kflogs.SimpleJsonFormatter())
logger.addHandler(handler)

logger.warning('Warnig!!')

Sample output

{
  "msecs": 146.5139389038086,
  "args": [],
  "name": "foo",
  "thread": 140735094612736,
  "created": 1492418072.146514,
  "process": 52942, "threadName":
  "MainThread", "module":
  "test", "filename":
  "test.py", "levelno": 30,
  "processName": "MainProcess",
  "pathname": "test.py",
  "lineno": 11,
  "exc_text": null,
  "exc_info": null,
  "funcName": "<module>",
  "relativeCreated": 884.4590187072754,
  "levelname": "WARNING",
  "msg": "Warnig!!"
}

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created and maintained by Masashi Terui (marcy9114@gmail.com)

License

MIT License (see LICENSE)

You can’t perform that action at this time.