Library in Python to store logs in MongoDB and send notifications of errors to Microsoft Teams
Project description
LOGZE
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.7.tar.gz
(3.6 kB
view hashes)
Built Distribution
logze-0.1.7-py3-none-any.whl
(4.3 kB
view hashes)