1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/logger/loggerutils/log_option_helpers.go
Jussi Nummelin 3cf82ff1ab Added flag to ignore fluentd connect error on container start
Signed-off-by: Jussi Nummelin <jussi.nummelin@gmail.com>

Changed buffer size to 1M and removed unnecessary fmt call

Signed-off-by: Jussi Nummelin <jussi.nummelin@gmail.com>

Updated docs for the new fluentd opts

Signed-off-by: Jussi Nummelin <jussi.nummelin@gmail.com>
2016-01-27 09:05:44 +02:00

26 lines
769 B
Go

package loggerutils
import (
"fmt"
"strconv"
"github.com/docker/docker/daemon/logger"
)
const (
defaultFailOnStartupError = true // So that we do not break existing behaviour
)
// ParseFailOnStartupErrorFlag parses a log driver flag that determines if
// the driver should ignore possible connection errors during startup
func ParseFailOnStartupErrorFlag(ctx logger.Context) (bool, error) {
failOnStartupError := ctx.Config["fail-on-startup-error"]
if failOnStartupError == "" {
return defaultFailOnStartupError, nil
}
failOnStartupErrorFlag, err := strconv.ParseBool(failOnStartupError)
if err != nil {
return defaultFailOnStartupError, fmt.Errorf("invalid connect error flag %s: %s", failOnStartupError, err)
}
return failOnStartupErrorFlag, nil
}