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
TextChoicesfor 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:
-
Clone the repository:
pip install loghero
-
Add
logheroto yourINSTALLED_APPSin your Django project'ssettings.py:INSTALLED_APPS = [ ... 'loghero', ... ]
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loghero-1.2.2.tar.gz.
File metadata
- Download URL: loghero-1.2.2.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
222a1bcc530c971c15599ac7790e1a75995702fde8985e07b3200a5d97c2de20
|
|
| MD5 |
6755abc1ea296600bf32d5102cf0eb90
|
|
| BLAKE2b-256 |
1ad2a4a7da12973ce0ee0937ae74f040b3a9f58f208a9437f7bdecfe6674fbb2
|
Provenance
The following attestation bundles were made for loghero-1.2.2.tar.gz:
Publisher:
python-publish.yml on rh363/loghero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loghero-1.2.2.tar.gz -
Subject digest:
222a1bcc530c971c15599ac7790e1a75995702fde8985e07b3200a5d97c2de20 - Sigstore transparency entry: 261390393
- Sigstore integration time:
-
Permalink:
rh363/loghero@de9d0d15e81c8e807bf58703ae64c37d37a160c1 -
Branch / Tag:
refs/tags/1.2.2 - Owner: https://github.com/rh363
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@de9d0d15e81c8e807bf58703ae64c37d37a160c1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file loghero-1.2.2-py3-none-any.whl.
File metadata
- Download URL: loghero-1.2.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24c0169024f5fd76340dfed5044d5c1e23a0a8a4cce50a94cf91090bf697278a
|
|
| MD5 |
5e3720926c5ea6dc39c63ed2c7695721
|
|
| BLAKE2b-256 |
42450a37f83e68fc202ab07d1fd1e235a497e7501f760c93eaa1b94b8c53db16
|
Provenance
The following attestation bundles were made for loghero-1.2.2-py3-none-any.whl:
Publisher:
python-publish.yml on rh363/loghero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loghero-1.2.2-py3-none-any.whl -
Subject digest:
24c0169024f5fd76340dfed5044d5c1e23a0a8a4cce50a94cf91090bf697278a - Sigstore transparency entry: 261390400
- Sigstore integration time:
-
Permalink:
rh363/loghero@de9d0d15e81c8e807bf58703ae64c37d37a160c1 -
Branch / Tag:
refs/tags/1.2.2 - Owner: https://github.com/rh363
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@de9d0d15e81c8e807bf58703ae64c37d37a160c1 -
Trigger Event:
release
-
Statement type: