Integrate HealthCheck middleware

This commit is contained in:
Joel Speed
2020-06-14 21:05:17 +01:00
parent ca416a2ebb
commit 9bbd6adce9
8 changed files with 47 additions and 262 deletions
+2 -6
View File
@@ -9,7 +9,7 @@ import (
)
// configureLogger is responsible for configuring the logger based on the options given
func configureLogger(o options.Logging, pingPath string, msgs []string) []string {
func configureLogger(o options.Logging, msgs []string) []string {
// Setup the log file
if len(o.File.Filename) > 0 {
// Validate that the file/dir can be written
@@ -48,11 +48,7 @@ func configureLogger(o options.Logging, pingPath string, msgs []string) []string
logger.SetAuthTemplate(o.AuthFormat)
logger.SetReqTemplate(o.RequestFormat)
excludePaths := o.ExcludePaths
if o.SilencePing {
excludePaths = append(excludePaths, pingPath)
}
logger.SetExcludePaths(excludePaths)
logger.SetExcludePaths(o.ExcludePaths)
if !o.LocalTime {
logger.SetFlags(logger.Flags() | logger.LUTC)
+1 -1
View File
@@ -264,7 +264,7 @@ func Validate(o *options.Options) error {
msgs = parseSignatureKey(o, msgs)
msgs = validateCookieName(o, msgs)
msgs = configureLogger(o.Logging, o.PingPath, msgs)
msgs = configureLogger(o.Logging, msgs)
if o.ReverseProxy {
parser, err := ip.GetRealClientIPParser(o.RealClientIPHeader)