Skip to main content

Library in Python to store logs in MongoDB and send notifications of errors to Microsoft Teams

Project description

LOGZE

PyPI version fury.io PyPI download month Bandit Percentage of issues still open MIT License

Library in Python to store logs in MongoDB and send notifications of errors to MS Teams.

Install

Install logze using PyPI or directly via pip:

  pip install logze

Usage

from logze.recorder.logger import LogRecorder
from logze.models.log import Log


recorder = LogRecorder("{YOUR_CONN_STRING}", "{DB_NAME}", "{COLLECTION_NAME}", "{MS_TEAMS_WEBHOOK}")

log = Log("{SOURCE}", "{LOG_TYPE}", "{MESSAGE}", "{EVENT}")
recorder.record_log(log)

Running unit tests

$ export MONGO_URI="mongodb://user:password@host:port/?authMechanism=DEFAULT"
$ export DB_NAME="YOUR_DB_NAME"
$ python -m unittest discover tests
...
------------------------------------------------------------------------------
Ran 3 tests in 0.144s

OK

Author

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

logze-0.1.8.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

logze-0.1.8-py3-none-any.whl (4.4 kB view hashes)

Uploaded 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