Logarithm::StructuredLogger
Enhanced logger with structured logging support
This class provides centralized logging capabilities with support for both human-readable text format and structured JSON format. Includes audit trail functionality and performance-optimized logging.
Features
- Structured JSON logging
- Audit trail support
- Configurable output format
- Log file rotation
Configuration
Environment variables:
- LOG_FORMAT: JSON, TEXT (default: TEXT)
- LOG_FILE: Optional log file path
Usage
logger = StructuredLogger.new
logger.log(Log::Severity::Info, "Message") do |entry|
entry.context = {"key" => "value"}
end
Constructors
new
SourceInstance methods
setup_log_level
Source