Logger for the logging module that writes messages to the database
Project description
Logger for the logging module that writes messages to the django database
Installation
Install using pip:
pip install --upgrade django-logging-eventlog
Modify your settings.py. Add eventlog to your INSTALLED_APPS:
INSTALLED_APPS = [ #django apps 'eventlog', #your apps ]
Configure your LOGGING for example:
LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'eventlog': { 'class': 'eventlog.services.EventLogHandler' }, }, 'loggers': { 'console': { 'class': 'logging.StreamHandler', }, 'file': { 'class': 'logging.handlers.FileHandler', 'filename': 'app.log', }, 'root': { 'handlers': ['file', 'console', 'eventlog'], 'level': 'INFO', }, 'eventlog': { 'handlers': ['eventlog', ], 'level': 'INFO', }, } }
Run python manage.py makemigrations eventlog and run Run python manage.py migrate
Usage
import logging
logger = logging.getLogger(__name__)
logger.info('info')
logger.debug('debug')
logger.error('error')
logger.critical('critical')
logger.warning('warning')
try:
1/0
except Exception as ex:
logger.exception(ex, exc_info=ex)
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
Built Distribution
Close
Hashes for django-logging-eventlog-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea28f5d4ea5ba95a9126735f9c380eab43e8ee2d95d5db16f0276d98a49e3a2f |
|
MD5 | e34e207da809772e13965090210a594d |
|
BLAKE2b-256 | d6a5e033a630ec7ad1d2c8fccd6f760955fa3f31ade2d68d6b37bc80c21f0f50 |
Close
Hashes for django_logging_eventlog-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3aaa71d37b51b621d0e4c78336198eb41d6048446ddf4090d0ecbe5929f99a |
|
MD5 | fa9292f57bd3083152c7476339c80bd2 |
|
BLAKE2b-256 | 922fd8ebf22b7faa8f13b5e3d93c6ea06c53a201e4deb868609825c3fd18909b |