feat: adds configurable HTTP request path exclusion from logging

This commit is contained in:
2025-08-26 14:51:39 -04:00
parent 2310ac574c
commit 063ff0f1d0
3 changed files with 43 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ import (
"flag"
"fmt"
"os"
"regexp"
"runtime/debug"
"time"
@@ -105,6 +106,12 @@ func prepareConfig(cfg *AppConfig) error {
}
}
// Prepare user-provided expressions, panic up-front if invalid
cfg.HTTP.excludeRegexps = make([]*regexp.Regexp, len(cfg.HTTP.LogExcludePathRegexps))
for i, re := range cfg.HTTP.LogExcludePathRegexps {
cfg.HTTP.excludeRegexps[i] = regexp.MustCompile(re)
}
return errs
}