Expand description
Log monitoring for attacks, protocol issues, and debugging.
This module provides log monitoring functionality that buffers recent Tor log messages and dumps them when circuits are closed, helping with debugging and attack detection.
§Overview
The logguard system:
- Buffers log messages: Keeps recent log entries up to a configurable limit
- Dumps on circuit close: Outputs buffered logs before and after circuit closure
- Monitors warnings: Logs Tor WARN-level messages at NOTICE level
- Enables ProtocolWarnings: Optionally enables Tor’s ProtocolWarnings setting
§Configuration
Key configuration options in crate::config::LogguardConfig:
| Option | Default | Description |
|---|---|---|
protocol_warns | true | Enable ProtocolWarnings in Tor |
dump_limit | 25 | Maximum log entries to buffer |
dump_level | NOTICE | Minimum log level to buffer |
§What This Module Does NOT Do
- Log rotation: Use external tools for log file management
- Log persistence: Buffered logs are lost on restart
- Attack prevention: This module aids debugging, not prevention
§See Also
crate::config::LogguardConfig- Configuration optionscrate::logger- Main logging infrastructure- Python vanguards logguard