38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package logger
|
|
|
|
import "time"
|
|
|
|
// Config содержит настройки для всех компонентов логирования
|
|
type Config struct {
|
|
// Retention настройки
|
|
RetentionHours int
|
|
RetentionMB int
|
|
RetentionIntervalMin time.Duration
|
|
|
|
// Мониторинг тишины
|
|
Silence5Min time.Duration
|
|
Silence10Min time.Duration
|
|
WatchdogIntervalMin time.Duration
|
|
|
|
// Анти-спам и интервалы
|
|
AlertCooldownSec time.Duration
|
|
HumanLogIntervalSec time.Duration
|
|
|
|
// Буфер
|
|
BufferSize int
|
|
}
|
|
|
|
// DefaultConfig возвращает конфигурацию по умолчанию
|
|
func DefaultConfig() *Config {
|
|
return &Config{
|
|
RetentionHours: 48,
|
|
RetentionMB: 5000,
|
|
RetentionIntervalMin: 15 * time.Minute,
|
|
Silence5Min: 5 * time.Minute,
|
|
Silence10Min: 10 * time.Minute,
|
|
WatchdogIntervalMin: 1 * time.Minute,
|
|
AlertCooldownSec: 10 * time.Second,
|
|
HumanLogIntervalSec: 5 * time.Second,
|
|
BufferSize: 10240,
|
|
}
|
|
} |