Skip to main content

Django log viewer

Project description

pypi version license build status

Django Log Viewer allows you to read & download log files in the admin page by using DataTables. This project was modified from:

Quick start

  1. Django Log Viewer is available directly from PyPI:
pip install django-log-viewer
  1. Add "log_viewer" to your INSTALLED_APPS setting like this
  1. Include the log viewer URLconf in your project like this
path('admin/log_viewer/', include('log_viewer.urls')),
  1. In your file create the following value
LOG_VIEWER_FILES = ['logfile1', 'logfile2', ...]
LOG_VIEWER_FILES_DIR = os.path.join(BASE_DIR, '../logs')
LOG_VIEWER_MAX_READ_LINES = 1000  # total log lines will be read
LOG_VIEWER_PAGE_LENGTH = 25       # total log lines per-page

# Optionally you can set the next variables in order to customize the admin:

LOG_VIEWER_FILE_LIST_STYLES = "/static/css/my-custom.css"
  1. Create/register the logging
import logging
logger = logging.getLogger('LoggerName')'The info message')
logger.warning('The warning message')
logger.error('The error message')
  1. Deploy static files by running the command
python collectstatic
  1. Start the development server and visit

Download files

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

Files for django-log-viewer, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size django-log-viewer-1.1.2.tar.gz (75.4 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 Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page