feat: adds configurable HTTP request path exclusion from logging
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user