class

KemalWAF::LogRotator

Inherits Reference / Object

Log rotation yöneticisi

Constants

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

Constructors

new(log_dir : String, max_size_mb : Int32, retention_days : Int32)
Source

Instance methods

cleanup_old_logs(base_name : String, current_date : Time = Time.local)

Eski log dosyalarını temizle

Source
ensure_log_file(base_name : String, current_date : Time = Time.local) : String

Mevcut log dosyasını döndür (rotation gerekirse yapar)

Source
get_current_log_file(base_name : String, date : Time = Time.local) : String

Date-based dosya ismi oluştur

Source
get_file_size_mb(file_path : String) : Float64

Dosya boyutunu MB cinsinden döndür

Source
get_rotated_file_name(base_file_path : String, current_date : Time = Time.local) : String

Create new file name for size-based rotation

Source
rotate_log_file(file_path : String, current_date : Time = Time.local) : String | Nil

Dosya rotation işlemi

Source
should_rotate?(file_path : String, current_date : Time = Time.local) : Bool

Rotation gerekip gerekmediğini kontrol et

Source