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
Add “db_logger” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'db_logger', ]
Run python manage.py migrate to create the polls models.
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', } } }
Visit /admin/db_logger/dblogentry/ to check the logs.
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
db-logger-1.0.tar.gz
(3.0 kB
view hashes)