Skip to main content

Django log viewer

Project description

pypi version license build status

Django Log Viewer allows you to read log files in the admin page. This project was modified from: https://bitbucket.org/inkalabsinc/django-log-viewer


https://i.imgur.com/XXlsszz.png

Quick start

  1. Include the log viewer URLconf in your project urls.py like this

pip install django-log-viewer
  1. Add "log_viewer" to your INSTALLED_APPS setting like this

INSTALLED_APPS = [
    ...
    "log_viewer",
]
  1. Include the log viewer URLconf in your project urls.py like this

path('admin/log_viewer/', include('log_viewer.urls')),
  1. In your settings file create the following value

LOG_VIEWER_FILES = ['logfile1', 'logfile2', ...]
LOG_VIEWER_FILES_DIR = os.path.join(BASE_DIR, '../logs')
LOG_VIEWER_ITEMS_PER_PAGE = 50

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

LOG_VIEWER_FILE_LIST_TITLE = "Custom title"
LOG_VIEWER_FILE_LIST_STYLES = "/static/css/my-custom.css"
  1. Create/register the logging

import logging
logger = logging.getLogger('my_handler')  # eg: log_viewer_demo/log_viewer_demo/logger.py
logger.info('My log')
logger.warning('My log')
logger.error('My log')
  1. Start the development server and visit http://127.0.0.1:8000/admin/log_viewer/

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

django-log-viewer-1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file django-log-viewer-1.0.1.tar.gz.

File metadata

  • Download URL: django-log-viewer-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for django-log-viewer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 779d593a1b04f8f63b64a4be98b0c9662bf0ac0dc115c6bc29066f684445467e
MD5 9f2d599d3100a852fac31c88f4b51be8
BLAKE2b-256 1e68a262a5140e323bed96ecb827f5afc3e9340c9432750f7b1c6aae3ff268a4

See more details on using hashes here.

Provenance

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