Skip to main content

Real-Time monitoring and analysis of logs

Project description

Django Log Inspector

Fast and Live view to your log files

version Open Source GitHub

Django Log Inspector offers real-time monitoring and analysis of log files in Django projects. It delivers a fast and live-view of log data, eliminating manual page refreshing. With an intuitive interface and live update functionality, it streamlines log file management for easier issue tracking and troubleshooting in Django applications.

Django Log Inspector is available directly from PyPI:

Installation

pip install django-log-inspector

Add in INSTALLED_APPS

installed_apps = [
    ...
    'log_inspector',
]

Include in the URLconf

path('logs/', include('log_inspector.urls'))

Settings

The directory of log files in your project

LOG_INSPECTOR_FILES_DIR = 'logs/'

A file is included if the pattern is matched, or it is specified

LOG_INSPECTOR_FILES = ['logfile1', 'logfile2', ...] # default: []
LOG_INSPECTOR_FILES_PATTERN = '*.log*'            

You must specify the patterns in which your log files start with

Note: Make sure you have a formatter specified for your logs in django settings

LOG_INSPECTOR_PATTERNS = ['[INFO]', '[DEBUG]', '[WARNING]', '[ERROR]', '[CRITICAL]']

How logs are displayed

LOG_INSPECTOR_PAGE_LENGTH = 25             # total logs per-page
LOG_INSPECTOR_MAX_READ_LINES = 1000        # total logs that are read
LOG_INSPECTOR_EXCLUDE_TEXT_PATTERN = None  # String regex expression to exclude the log

Optionally you can set the next variables in order to customize

LOG_INSPECTOR_FILE_LIST_TITLE = "Custom title"               # default: None
LOG_INSPECTOR_FILE_LIST_STYLES = "/static/css/my-custom.css" # default: None

Login

Logs are only accessible to logged-in superusers. If your login URL is different from Django's default, specify it in your settings.

LOGIN_URL = '/my-custom-admin/login/'

Static Files

Deploy static files by running the command

python manage.py collectstatic

Finally

Start the development server and visit

http://127.0.0.1:8000/logs/

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_inspector-0.0.9.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

django_log_inspector-0.0.9-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file django_log_inspector-0.0.9.tar.gz.

File metadata

  • Download URL: django_log_inspector-0.0.9.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for django_log_inspector-0.0.9.tar.gz
Algorithm Hash digest
SHA256 6731151ec6ac295829a6d9bd99f0bcffba4113c08f7697f0348ac3fb3b851d1d
MD5 fef1fe81f2d752e1b74d11c255626e3b
BLAKE2b-256 80678f4a5f6dc5e6b7ecd801d38161f155cfe9dd79792cf37e08a47879c327b5

See more details on using hashes here.

File details

Details for the file django_log_inspector-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for django_log_inspector-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1bdb44fd725a4df9b417d83369824c34ece48d3c95f2a6835b1f5db726ea06cf
MD5 46ffa4dae7ccd43a767d1c4edd788ae3
BLAKE2b-256 ea0981a30ceea0188ed588a884e4e075f47120d2d010351bf53c976b1a34354c

See more details on using hashes here.

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