Skip to main content

Advanced logging and monitoring for Django applications

Project description

Test Status PyPI Version Python Versions License Code Coverage Black

Logmancer

Advanced logging and monitoring for Django applications.

Features

  • Database Logging – Store logs in your Django database

  • Middleware Integration – Automatic HTTP request/response logging

  • Django Signals – Monitor model changes automatically

  • Admin Interface – Beautiful Django admin integration

  • Advanced Filtering – Filter logs by level, source, timestamp, and more

  • Sensitive Data Masking – Automatically mask passwords and sensitive data

  • Configurable – Extensive configuration options

  • JSON Support – Store structured data with JSON fields

  • Cleanup Commands – Built-in management commands for maintenance

Quick Start

Install:

pip install django-logmancer

Add to your settings.py:

INSTALLED_APPS = [
    # ... your apps
    'logmancer',
]

MIDDLEWARE = [
    # ... your middleware
    'logmancer.middleware.DBLoggingMiddleware',
]

LOGMANCER = {
    'ENABLE_SIGNALS': True,
    'ENABLE_MIDDLEWARE': True,
    'LOG_LEVEL': 'INFO',
    'EXCLUDE_PATHS': ['/admin/jsi18n/', '/static/', '/media/'],
    'EXCLUDE_MODELS': ['logmancer.LogEntry', 'auth.Session'],
    'MASK_SENSITIVE_DATA': ['password', 'token', 'secret', 'key'],
    'CLEANUP_AFTER_DAYS': 30,
}

Run migrations:

python manage.py migrate logmancer

Manual Logging Example

from logmancer.utils import LogEvent

LogEvent.info("User login successful")
LogEvent.error("Payment failed", meta={"user_id": 123, "amount": 99.99})

Admin Interface

  • Navigate to /admin/logmancer/logentry/

  • Filter by level, source, timestamp, actor type

  • Search through log messages

  • View detailed metadata in JSON format

License

MIT License. See LICENSE for details.

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_logmancer-0.1.3.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

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

django_logmancer-0.1.3-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file django_logmancer-0.1.3.tar.gz.

File metadata

  • Download URL: django_logmancer-0.1.3.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_logmancer-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d9f378549472e6094988ea2a1def2bb3b518d01106341a36f40b6a7578c94ef9
MD5 a5f4c424f5a7d675004ef2e7d3ccafb9
BLAKE2b-256 380ae17b45bc2ac5f69517c256baa16b1515720f74e83ddd0584aee9293646f1

See more details on using hashes here.

File details

Details for the file django_logmancer-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_logmancer-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33a1de933be57aa761b5da86dcf862b940a0d02a70a21145b2d75f2404545661
MD5 8afba529577fca0dc8b88f6397321de3
BLAKE2b-256 f625f803d9caa01ccf9d30a5afae8998708179a80d10c5a1bf6296386bb9bf7f

See more details on using hashes here.

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