Skip to main content

A simple Django app to save logs to database

Project description

DB Logger is a simple Django app to save logs to database.

Quick start

  1. Add “db_logger” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'db_logger',
    ]
  2. Run python manage.py migrate to create the polls models.

  3. Add handler and logger to LOGGING setting like this:

    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'verbose': {
                'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
                'datefmt': "%d/%b/%Y %H:%M:%S"
            },
            'standard': {
                'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
            },
            'simple': {
                'format': '%(levelname)s %(message)s'
            },
        },
        'handlers': {
            'db_log': {
                'level': 'DEBUG',
                'class': 'db_logger.handlers.DbLogHandler'
            },
        },
        'loggers': {
            '': {
                'handlers': ['db_log'],
                'level': 'DEBUG',
            }
        }
    }
  4. Visit /admin/db_logger/dblogentry/ to check the logs.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

db-logger-1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

db_logger-1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file db-logger-1.0.tar.gz.

File metadata

  • Download URL: db-logger-1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for db-logger-1.0.tar.gz
Algorithm Hash digest
SHA256 c2092d99dfb7712af2f082798a95a64113800be4be48615203fbc4a1f3844bf2
MD5 83a8754425d684ad1e741db12c3b68c9
BLAKE2b-256 3ccac89b48ec7a2fc82ecd4e5594b556d6ac89c280949ede798a53f5790810e7

See more details on using hashes here.

File details

Details for the file db_logger-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for db_logger-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6108b1414c73b133e74b2229617efced8ed1c85edc2584478a9988a6790ef48
MD5 33faad38aedf6c3efa2b9c193a78025b
BLAKE2b-256 c1299ceff2cb107e464855b341a2b82b8b484e9134fd2952571e518217dead31

See more details on using hashes here.

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