Utility to write logging to influxdb2 in order to gather some application stats. After using this utility, user can create dashboard in Grafana with InfluxDB.
Project description
Logging Utility to Database
Utility to write logging to database in order to gather some application stats.
Free software: MIT license
Features
Funciton can be extended to different database in future.
A helper to log information to InfluxDB2 for further report purpose.
The functions here catch the errors, if anything goes wrong it still return and won’t break main program logic. But the information won’t be recorded in InfluxDB.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Developer’s Causion
This package is hosted by pypi public. Do not include any sensitive information in this project.
Usage
Install
Installation
pip install coelog2db
Usage:
import logging from log2db.log2db import Log2DB from log2db.log2influx import Log2Influx log2 = Log2DB.get_instance(Log2Influx,conf=conf["influxdb"],user="cronjob") log2.log(log_level=logging.INFO,message="Loading started") # log this message before acture logic starts try: # main code # make sure throw except in your code if you catched them in subprocess pass except Exception as ex: log2.log(logging.ERROR,message="download job failed. " + str(ex))
History
0.1.1 (2022-06-01)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for coelog2db-0.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11348d8782e894b013ba08df6f518cc4484c102a938e52d6d9145a6934bd1ace |
|
MD5 | 5b264154645df1d4d29be3056bd5ee5e |
|
BLAKE2b-256 | 65a71b5a674c7aa6402e9631b13421c2411e981d000f934672cbaa336874ab69 |