Module logguard

Module logguard 

Source
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:

OptionDefaultDescription
protocol_warnstrueEnable ProtocolWarnings in Tor
dump_limit25Maximum log entries to buffer
dump_levelNOTICEMinimum 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

Structs§

LogEntry
A buffered log entry from Tor.
LogGuard
Log monitoring state.