Skip to main content

No project description provided

Project description

A simple logging.Handler subclass to log to a database


pip install log2db


import logging
import os

from log2db import  LogDBHandler

db_path = os.path.abspath('logs.db')
db_handler = LogDBHandler(db_path)

logger = logging.getLogger(__name__)
logger.addHandler(db_handler)'This is going to be saved in a db')

The level of LogDBHandler can be set with the level argument in the constructor.

The handler saves the following properties of the logRecord:

  • logRecord.levelname
  • logRecord.levelno
  • logRecord.pathName
  • logRecord.funcName
  • logRecord.lineno
  • logRecord.created
  • logRecord.msg

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Log2DB, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size Log2DB-1.0.2-py3-none-any.whl (7.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Log2DB-1.0.2.tar.gz (6.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page