Django log viewer
Project description
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
Quick start
Include the log viewer URLconf in your project urls.py like this
pip install django-log-viewer
Add "log_viewer" to your INSTALLED_APPS setting like this
INSTALLED_APPS = [ ... "log_viewer", ]
Include the log viewer URLconf in your project urls.py like this
path('admin/log_viewer/', include('log_viewer.urls')),
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"
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')
Start the development server and visit http://127.0.0.1:8000/admin/log_viewer/
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
File details
Details for the file django-log-viewer-1.0.2.tar.gz
.
File metadata
- Download URL: django-log-viewer-1.0.2.tar.gz
- Upload date:
- Size: 4.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fbd245132b538ba9948be8af241939d782fae7ed90308bdaa1ed8c2160aa6a3 |
|
MD5 | 02258e8ee9c5a2f5eb816b96aeb5450f |
|
BLAKE2b-256 | 88d1dfa546952a44e66f97ddbe39461bcc5f58b2c2a666c6278b75453274161d |