Skip to main content

Django admin log viewer supporting MongoDB and SQL databases.

Project description

django-log-panel

Latest on Django Packages

django-log-panel displays your Django logs inside Django admin as a per-logger status dashboard with searchable log entries and optional threshold alerts, without a separate service to run.

Log panel dashboard showing per-logger health cards

Log panel dashboard showing a 90 day logger timeline

Log detail view with message search and paginated entries Log detail view with the level filter dropdown open

Features

  • A status-page style dashboard in Django admin, with one health card per logger.
  • A searchable, filterable log table for drilling into individual entries.
  • MongoDB and SQL storage backends, depending on how you want to store logs.
  • Threshold alerts through a Django signal that your application can react to.
  • Configurable ranges, colors, page size, title, and access control.
  • Automatic root-handler setup by default, with manual LOGGING control when needed.

Requirements

  • Python >= 3.12
  • Django >= 5.2
  • pymongo>=4.16.0,<5 only when using the MongoDB backend
  • A running, reachable MongoDB instance when using the MongoDB backend

Installation

# with uv
uv add django-log-panel

# with pip
pip install django-log-panel

For MongoDB support, install the optional extra. This installs the Python client only; you still need an actual MongoDB instance to connect to:

# with uv
uv add "django-log-panel[mongodb]"

# with pip
pip install "django-log-panel[mongodb]"

Choose a backend

Backend Use it when Retention Extra setup
MongoDB You want append-only logging with cheap writes and MongoDB TTL cleanup. Automatic TTL expiry on the collection. Install the mongodb extra, run a reachable MongoDB instance, and set CONNECTION_STRING.
SQL You want logs in a Django-managed relational database. Run the delete_old_logs management command on a schedule. Add LogsRouter, point DATABASE_ALIAS at the target database, and run the log_panel migration on that alias.

Quick start

1. Add the app

INSTALLED_APPS = [
    ...,
    "log_panel",
]

2. Configure one backend

MongoDB:

LOG_PANEL = {
    "CONNECTION_STRING": "mongodb://localhost:27017",
    "DB_NAME": "myapp_logs",
    "COLLECTION": "logs",
    "TTL_DAYS": 90,
}

This example assumes a MongoDB instance is running and reachable at localhost:27017.

SQL:

DATABASES["logs"] = {
    "ENGINE": "django.db.backends.postgresql",
    "NAME": "myapp_logs",
    "USER": "...",
    "PASSWORD": "...",
    "HOST": "...",
    "PORT": "...",
}

DATABASE_ROUTERS = [
    "log_panel.routers.LogsRouter",
]

LOG_PANEL = {
    "DATABASE_ALIAS": "logs",
    "TTL_DAYS": 90,
}

If you use the SQL backend, run the migration on the logging database:

python manage.py migrate log_panel --database=logs

3. Open Django admin

Go to Application Logs, or open:

/admin/log_panel/panel/

Once configured, any standard Python logger that flows through the selected handler will show up in the panel.

How log capture works

  • LOG_PANEL selects how the admin reads log data.
  • By default, log_panel auto-attaches the matching handler to the root logger at startup.
  • Set ATTACH_ROOT_HANDLER = False when you want full control through Django LOGGING.
  • LOG_LEVEL only affects the auto-attached root handler.
  • Stored fields come from the log record itself; LOGGING formatters do not reshape the stored data.

Full setup notes and manual LOGGING examples are in the backend guide.

Advanced topics

Contributing

For local work, use the uv workflow in docs/development.md.

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_panel-0.1.8.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_log_panel-0.1.8-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file django_log_panel-0.1.8.tar.gz.

File metadata

  • Download URL: django_log_panel-0.1.8.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_log_panel-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f6aa3b48bc29a378dd470fd1030385a726c4251b576fbbf2df027499eb246a07
MD5 1a4f9e49e480bd6093ee01d06b4d9222
BLAKE2b-256 3c4638b9c4da7adefcc67ea55d0c10622270bdc32b55bacd1708c1604ee1194b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_log_panel-0.1.8.tar.gz:

Publisher: release.yml on rreiter3/django-log-panel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_log_panel-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for django_log_panel-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ea60dcef0f82b11c15617e304b1439ef90e9c2e54b1ae39f8b4ad430afd19fae
MD5 357ad8a2dedc622b84c45971fc9c6fdb
BLAKE2b-256 06ee6a98d942f2a7f49051a315dcbf77febafc482e08d9234471a1badcbeda28

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_log_panel-0.1.8-py3-none-any.whl:

Publisher: release.yml on rreiter3/django-log-panel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page