Skip to main content

LogHero

LogHero is a simple Django application designed to log generic information in the database in a structured way. It provides a convenient way to record and manage logs with customizable severity and status levels.

Project Overview

  • Name: LogHero
  • Version: 1.1.0
  • Description: A Django app for structured logging of various actions and information.
  • License: OSI Approved :: The Unlicense
  • Homepage: LogHero on GitHub
  • Issues: Issue Tracker

Features

  • Logging: Tracks actions, actors, target entities, severities, statuses, and contextual metadata.
  • Admin Integration: Provides an admin interface for log monitoring and filtering.
  • Enums for Choices: Uses Django's TextChoices for handling log statuses and severities.
  • Location auto discovery: LogHero use hostip_client for get ip location from hostip.info.

Prerequisites

  • Python 3.8 or higher
  • Django 4.2 or higher

Installation

To install LogHero, follow these steps:

  1. Clone the repository:

    pip install loghero
    
  2. Add loghero to your INSTALLED_APPS in your Django project's settings.py:

    INSTALLED_APPS = [
        ...
        'loghero',
        ...
    ]
    
  3. Run database migrations:

    python manage.py migrate
    

Usage

Logging Actions

Use the add_log function to create a new log entry:

from loghero.models import Severity, Status
from loghero import add_log, get_client_ip

ip = get_client_ip(request) # django http request optional
add_log(
    actor='John Doe',
    action='Login Attempt',
    severity=Severity.INFO,
    status=Status.SUCCESS,
    target='user@example.com',
    target_type='User',
    ip_address=ip, #optional
)

Admin Interface

Access the admin panel to view and filter log entries. Customize log visibility using admin configurations in admin.py:

  • Display crucial log attributes.
  • Filter logs by severity and status.
  • Search through logs using predefined fields.

Contributing

If you wish to contribute to LogHero, feel free to open issues or submit pull requests via the GitHub repository linked above.

License

This project is licensed under the terms of The Unlicense.

Dependencies

The project depends on the following packages:

  • Django
  • ASGIRef
  • Certifi
  • Charset Normalizer
  • Hostip Client
  • IDNA
  • Requests
  • SQLParse
  • URLLib3

Metadata

Release files for loghero 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loghero 1.2.2
File Size Uploaded
loghero-1.2.2.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loghero 1.2.2
File Interpreter ABI Platform
loghero-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.0 kB

Release files / loghero-1.2.2.tar.gz

Download URL loghero-1.2.2.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
222a1bcc530c971c15599ac7790e1a75995702fde8985e07b3200a5d97c2de20
BLAKE2b-256 checksum
How to use checksums
1ad2a4a7da12973ce0ee0937ae74f040b3a9f58f208a9437f7bdecfe6674fbb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 3, 2025.

Transparency log

Release files / loghero-1.2.2-py3-none-any.whl

Download URL loghero-1.2.2-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24c0169024f5fd76340dfed5044d5c1e23a0a8a4cce50a94cf91090bf697278a
BLAKE2b-256 checksum
How to use checksums
42450a37f83e68fc202ab07d1fd1e235a497e7501f760c93eaa1b94b8c53db16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 3, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page