class

KemalWAF::StructuredLogger

Inherits Reference / Object

Structured logger - asenkron JSON logging

Constants

Log = ::Log.for("structured_logger")

Constructors

new(log_dir : String, base_name : String, max_size_mb : Int32, retention_days : Int32, queue_size : Int32 = 10000, batch_size : Int32 = 100, flush_interval_ms : Int32 = 1000)
Source

Instance methods

log_error(error : Exception, context : Hash(String, String) = {} of String => String)

Error loglama (non-blocking)

Source
log_rate_limit(request : HTTP::Request, result : RateLimitResult, request_id : String | Nil = nil, start_time : Time | Nil = nil)

Rate limit loglama (non-blocking)

Source
log_request(request : HTTP::Request, result : EvaluationResult, duration : Time::Span, request_id : String | Nil = nil, start_time : Time | Nil = nil)

Request loglama (non-blocking)

Source
log_rule_match(rule : Rule, variable : String, value : String, request_id : String | Nil = nil)

Rule match loglama (non-blocking)

Source
shutdown

Graceful shutdown - queue'daki tüm log'ları yaz

Source