Skip to main content

Simple app for log some generic infos on db in a structured way

Project description

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

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

loghero-1.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

loghero-1.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file loghero-1.1.0.tar.gz.

File metadata

  • Download URL: loghero-1.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for loghero-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3d808fd6fec5de8f081813e6231babb7608702849d0b45b78bd109f9a7eb8f8a
MD5 4ca82b411d6fc19a838dff1d5b433f3e
BLAKE2b-256 cefc5141c50b3cf73eb88d2ea123fd9b3429e03644464fbcf542a9669d9e7eba

See more details on using hashes here.

Provenance

The following attestation bundles were made for loghero-1.1.0.tar.gz:

Publisher: python-publish.yml on rh363/loghero

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

File details

Details for the file loghero-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: loghero-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for loghero-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01d3ca80e76edf418b052a1a3360f8dac2b7415e0ce3c5992f45ce8c9e772ce3
MD5 b3193ee5bca097106b1d017f684ba6ab
BLAKE2b-256 cc1169f097d663147f946f6c85d9724c6ae62761e5abd9e336e7f19fdf1eaa14

See more details on using hashes here.

Provenance

The following attestation bundles were made for loghero-1.1.0-py3-none-any.whl:

Publisher: python-publish.yml on rh363/loghero

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