Limit and split production logs

This commit is contained in:
ShukeBta
2026-06-16 12:58:27 +08:00
parent 877912fe4b
commit 3f40b18909
7 changed files with 287 additions and 16 deletions
+3
View File
@@ -34,6 +34,9 @@ func TestLoadDefaults(t *testing.T) {
if cfg.Database.Type != "auto" {
t.Fatalf("expected default database type auto, got %q", cfg.Database.Type)
}
if cfg.Logging.Level != "warn" || !cfg.Logging.EnableRotation || cfg.Logging.MaxSizeMB != 20 {
t.Fatalf("expected warn rotating logs by default, got level=%q rotation=%v max=%d", cfg.Logging.Level, cfg.Logging.EnableRotation, cfg.Logging.MaxSizeMB)
}
if cfg.Database.MaxOpenConns != defaultDatabaseMaxOpenConns {
t.Fatalf("expected default MaxOpenConns %d, got %d", defaultDatabaseMaxOpenConns, cfg.Database.MaxOpenConns)
}