mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
3cf82ff1ab
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>
26 lines
769 B
Go
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
|
|
}
|