ViraxLog is a high-security logging system designed to guarantee full integrity of your event logs. Using cryptographic chaining (Blockchain-style), each entry is linked to the previous one, making any modification or deletion detectable.
| Feature | Description |
|---|---|
| π Cryptographic Chaining | Each log contains the SHA-256 hash of the previous entry, ensuring full integrity. |
| β‘ Asynchronous & High Performance | Uses a queue and worker thread to never block your main application. |
| π¦ Batch Writing | Optimized SQLite writes in configurable batches to reduce disk I/O. |
| π Built-in Audit | Native tools to verify database integrity and detect chain breaks. |
| π₯οΈ CLI Interface | Ready-to-use commands to initialize, view, and monitor logs. |
| π οΈ Watchers | System monitoring (CPU, RAM, Heartbeat) integrated directly into the log stream. |
| π Security | Designed to resist tampering and ensure authenticity of log data. |
Clone the repository and install the project with dependencies:
git clone https://github.com/damienos61/viraxlog.git
cd viraxlog
pip install -e .pip install -e ".[dev]"from viraxlog.core import ViraxLogger
from viraxlog.models import ViraxConfig
# 1. Custom Configuration
config = ViraxConfig(
db_name="secure_logs.db",
batch_size=10 # Writes to DB every 10 messages
)
# 2. Initialize Logger
logger = ViraxLogger(config)
# 3. Log Events
logger.log("INFO", "AUTH", "Admin user logged in")
logger.log("WARNING", "SYSTEM", "High CPU temperature", data={"temp": 75})
# 4. Graceful Shutdown (flush remaining logs)
logger.shutdown()Check that no one has tampered with your SQLite logs:
from viraxlog.audit import AuditManager
auditor = AuditManager("secure_logs.db")
is_valid, error_report = auditor.verify_chain()
if is_valid:
print("β
Integrity confirmed: No log entries were altered.")
else:
print(f"β Corruption alert: Issue detected at index {error_report}")The project comes with a complete unit test suite covering cryptography, database, and async engine.
pytestExpected result: 12 passed
| File | Description |
|---|---|
src/viraxlog/core.py |
Main engine, async thread handling. |
src/viraxlog/database.py |
SQLite persistence manager. |
src/viraxlog/audit.py |
Verification and security audit logic. |
src/viraxlog/utils/crypto.py |
SHA-256 hashing functions. |
src/viraxlog/utils/helpers.py |
Utility functions (sanitization, formatting). |
src/viraxlog/watchers.py |
System monitoring sensors. |
src/viraxlog/interface.py |
Simplified facade, global singleton, logging helpers. |
src/viraxlog/viewer.py |
CLI to view logs in real-time. |
damienos61 GitHub: @damienos61
This project is licensed under the MIT License - see the LICENSE file for details.