logs-hook
A robust, secure, and configurable logging system for Kodachi OS
Version: 9.0.1 | Size: 2.7MB | Author: Warith Al Maawali
License: Proprietary | Website: https://digi77.com
File Information
Property | Value |
---|---|
Binary Name | logs-hook |
Version | 9.0.1 |
Build Date | 2025-09-23T19:20:02.659679871Z |
Rust Version | 1.88.0 |
File Size | 2.7MB |
JSON Data | View Raw JSON |
SHA256 Checksum
Features
Feature | Description |
---|---|
Feature | Centralized logging system |
Feature | Log rotation with configurable limits |
Feature | Secure log wiping |
Feature | Multiple log levels support |
Feature | JSON output format |
Feature | Embedded configuration system |
Security Features
Feature | Description |
---|---|
Authentication | Integrates with online-auth service |
Encryption | Supports encrypted log storage |
Inputvalidation | Sanitizes script names and messages |
Ratelimiting | Built-in protection against log spam |
System Requirements
Requirement | Value |
---|---|
OS | Linux (Debian-based) |
Privileges | root/sudo for system logs |
Dependencies | tokio runtime, filesystem access |
Global Options
Flag | Description |
---|---|
-h, --help |
Print help information |
-v, --version |
Print version information |
-n, --info |
Display detailed information |
-e, --examples |
Show usage examples |
--json |
Output in JSON format |
--json-pretty |
Pretty-print JSON output |
--json-filter <FIELDS> |
Filter JSON output fields |
--verbose |
Enable verbose output |
--quiet |
Suppress non-essential output |
--no-color |
Disable colored output |
-t, --timeout <SECS> |
Set timeout (default: 30) |
--retry <COUNT> |
Retry attempts (default: 3) |
-d, --work-dir <PATH> |
Working directory (defaults to auto-detected base directory) |
-o, --output-format <FORMAT> |
Force output format (default: text) |
--config <FILE> |
Use custom configuration file |
--fields <FIELD_LIST> |
Select specific fields to include in output |
--limit <NUMBER> |
Limit number of results returned |
--offset <NUMBER> |
Skip first N results (for pagination) |
Commands
Logging Commands
log
Log a message
Usage:
Options:
- --script, -s <SCRIPT>
: Script name for the log entry
- --level, -l <LEVEL>
: Log level (info, warn, error, debug, fatal)
Examples:
Maintenance Commands
maintenance rotate
Rotate log files
Usage:
Options:
- --file, -f <FILE>
: Specific log file to rotate
Examples:
maintenance wipe
Wipe log files
Usage:
Options:
- --all, -a
: Wipe all logs
- --file, -f <FILE>
: Specific log file to wipe
Examples:
Examples
Basic Usage
Common logging operations
Log an info message
Expected Output: Message logged successfullyLog a warning with short flags
Expected Output: Message logged successfullyLog with JSON output
Expected Output: JSON response with envelopeMaintenance Operations
Log rotation and cleanup
Rotate all log files
Expected Output: Log rotation completed for all filesWipe all logs
Expected Output: All logs wiped successfullyNote
Use with caution
Wipe specific log file
Expected Output: Specified log file wiped successfullyNote
File must exist and be writable
Advanced Usage
Complex operations and configurations
Custom timeout for long operations
Expected Output: Message logged successfullyPretty JSON output
Expected Output: Pretty-printed JSON responseJSON Output
Working with JSON formatted output
Version in JSON format
Expected Output: JSON envelope with version dataProgram info in JSON format
Expected Output: JSON envelope with program detailsLog with JSON output
Expected Output: JSON response with status and metadataRotate logs with JSON output
Expected Output: JSON response with rotation resultsWipe all logs with JSON output
Expected Output: JSON response with wipe resultsNote
Returns structured JSON with operation status
Troubleshooting
Debug and error handling
Enable verbose output
Expected Output: Detailed debug informationNote
Use for debugging issues
Enable Rust debug logging
Expected Output: Detailed internal debug outputNote
Shows internal library operations
Test with custom working directory
Expected Output: Message logged to custom pathNote
Useful for debugging path issues
Environment Variables
Variable | Description | Default | Values |
---|---|---|---|
RUST_LOG |
Set logging level | info | error |
NO_COLOR |
Disable all colored output when set | unset | 1 |
KODACHI_BASE_DIR |
Base directory for logs | auto-detected | /path/to/base/dir |
LOGS_HOOK_WORK_DIR |
Working directory for logging operations | current directory | /path/to/work/dir |
Exit Codes
Code | Description |
---|---|
0 | Success |
1 | General error |
2 | Invalid arguments |
3 | Permission denied |
4 | Network error |
5 | File not found |