logs-hook
A robust, secure, and configurable logging system for Kodachi OS
Version: 9.8.4 | Size: 1.6MB | Author: Warith Al Maawali
License: Proprietary | Website: https://digi77.com
File Information
| Property | Value |
|---|---|
| Binary Name | logs-hook |
| Version | 9.8.4 |
| Build Date | REDACTED-BUILD-TIME |
| Rust Version | 1.88.0 |
| File Size | 1.6MB |
| Author | Warith Al Maawali |
| License | Proprietary |
| Category | Kodachi Binary |
| Description | A robust, secure, and configurable logging system for Kodachi OS |
| Git Commit | unknown |
| Metadata Generated | 2026-06-28T11:16:29Z |
| Binary Timestamp | Unknown |
| JSON Data | View Raw JSON |
SHA256 Checksum
b356ccd675906d2fb7e39994a4d8e0520f9d079e2c0dd93780ce1598bebcaf76
Features
| # | Feature |
|---|---|
| 1 | Centralized logging system |
| 2 | Log rotation with configurable limits |
| 3 | Secure log wiping |
| 4 | Multiple log levels support |
| 5 | JSON output format |
| 6 | Embedded configuration system |
Security Features
| Feature | Description |
|---|---|
| Authentication | Not implemented in this crate (online-auth is a separate binary) |
| Encryption | Not implemented in this crate (log files are stored as plain text) |
| Input Validation | Sanitizes script names and messages |
| Rate Limiting | Not implemented in this crate (handled externally if required) |
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 (parsed globally; not applied by logs-hook) |
--verbose |
Enable verbose output (parsed globally; not applied by logs-hook) |
--quiet |
Suppress non-essential output (parsed globally; not applied by logs-hook) |
--no-color |
Disable colored output |
-t, --timeout <SECS> |
Set timeout (parsed globally; not applied by logs-hook) |
--retry <COUNT> |
Retry attempts (parsed globally; not applied by logs-hook) |
-d, --work-dir <PATH> |
Working directory (defaults to auto-detected base directory) |
-o, --output-format <FORMAT> |
Force output format (default: text) |
--config <FILE> |
Configuration file path (parsed globally; logs-hook uses embedded config only) |
--fields <FIELD_LIST> |
Select specific fields to include in output (parsed globally; not applied by logs-hook) |
--limit <NUMBER> |
Limit number of results returned (parsed globally; not applied by logs-hook) |
--offset <NUMBER> |
Skip first N results for pagination (parsed globally; not applied by logs-hook) |
Commands
Logging Commands
log
Log a message
Usage:
logs-hook log --script <SCRIPT> --level <LEVEL> <MESSAGE>
Options:
--script, -s <SCRIPT>: Script name for the log entry--level, -l <LEVEL>: Log level (info, warn, error, debug, fatal)
Examples:
logs-hook log --script 'my-script' --level info 'Script started'
logs-hook log -s 'backup' -l warn 'Low disk space'
logs-hook log --script 'app' --level error 'Connection failed' --json
Maintenance Commands
maintenance rotate
Rotate a specific log file (--file is required)
Usage:
logs-hook maintenance rotate --file <FILE>
Options:
--file, -f <FILE>: Log file to rotate (required; rotate-all is not supported)
Examples:
logs-hook maintenance rotate --file /path/to/log.txt
logs-hook maintenance rotate --file /path/to/log.txt --json
maintenance wipe
Wipe log files (--all, --file, or --confirm is required)
Usage:
logs-hook maintenance wipe (--all | --file <FILE> | --confirm)
Options:
--all, -a: Wipe all logs--file, -f <FILE>: Specific log file to wipe--confirm: Explicitly confirm wipe using the default policy (required when neither --all nor --file is given)
Examples:
logs-hook maintenance wipe --all
logs-hook maintenance wipe --file /path/to/log.txt
logs-hook maintenance wipe --all --json
logs-hook maintenance wipe --confirm
Operational Scenarios
Scenario-oriented workflows generated from the binary's built-in -e --json examples.
Scenario 1: Basic Usage
Common logging operations
Step 1: Log an info message
sudo logs-hook log --script 'my-script' --level info 'Script started'
Step 2: Log a warning with short flags
sudo logs-hook log -s 'backup' -l warn 'Low disk space'
Step 3: Log with JSON output
sudo logs-hook --json log --script 'app' --level error 'Failed'
Step 4: Log a debug message
sudo logs-hook log --script 'app' --level debug 'Verbose trace'
Step 5: Log a fatal message
sudo logs-hook log --script 'app' --level fatal 'Unrecoverable failure'
Note
Fatal level is the highest severity; reserve for unrecoverable conditions
Scenario 2: Maintenance Operations
Log rotation and cleanup
Step 1: Rotate a specific log file (--file is required)
sudo logs-hook maintenance rotate --file /path/to/log.txt
Note
--file is required; rotate-all is not supported
Step 2: Wipe all logs
sudo logs-hook maintenance wipe --all
Note
Use with caution
Step 3: Wipe specific log file
sudo logs-hook maintenance wipe --file /path/to/log.txt
Note
File must exist and be writable
Scenario 3: Advanced Usage
Complex operations and configurations
Step 1: Custom timeout for long operations
sudo logs-hook --timeout 60 log --script 'slow-task' --level info 'Starting'
Step 2: Pretty JSON output
sudo logs-hook --json-pretty log -s 'test' -l info 'Test'
Scenario 4: JSON Output
Working with JSON formatted output
Step 1: Version in JSON format
sudo logs-hook -v --json
Step 2: Program info in JSON format
sudo logs-hook -n --json
Step 3: Log with JSON output
sudo logs-hook --json log --script 'test' --level info 'message'
Step 4: Rotate a specific log file with JSON output
sudo logs-hook maintenance rotate --file /path/to/log.txt --json
Note
--file is required
Step 5: Wipe all logs with JSON output
sudo logs-hook maintenance wipe --all --json
Note
Returns structured JSON with operation status
Scenario 5: Troubleshooting
Debug and error handling
Step 1: Enable verbose output
sudo logs-hook --verbose log --script 'debug' --level debug 'Debug info'
Note
Use for debugging issues
Step 2: Test with custom working directory
sudo logs-hook --work-dir /custom/path log --script 'debug' --level info 'Custom directory test'
Note
Useful for debugging path issues
Environment Variables
| Variable | Description | Default | Values |
|---|---|---|---|
RUST_LOG |
Set logging level | info | error|warn|info|debug|trace |
NO_COLOR |
Disable all colored output when set | unset | 1|true|yes (any value disables color) |
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 |