Skip to content

Commit 7ed5c53

Browse files
committed
Signed-off-by: JamesJJ <[email protected]>
1 parent 3ce9258 commit 7ed5c53

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

daemon/logger/fluentd/fluentd.go

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const (
5353
retryWaitKey = "fluentd-retry-wait"
5454
maxRetriesKey = "fluentd-max-retries"
5555
asyncConnectKey = "fluentd-async-connect"
56+
asyncStopKey = "fluentd-async-stop"
5657
subSecondPrecisionKey = "fluentd-sub-second-precision"
5758
)
5859

@@ -118,6 +119,13 @@ func New(info logger.Info) (logger.Logger, error) {
118119
}
119120
}
120121

122+
asyncStop := false
123+
if info.Config[asyncStopKey] != "" {
124+
if asyncStop, err = strconv.ParseBool(info.Config[asyncStopKey]); err != nil {
125+
return nil, err
126+
}
127+
}
128+
121129
subSecondPrecision := false
122130
if info.Config[subSecondPrecisionKey] != "" {
123131
if subSecondPrecision, err = strconv.ParseBool(info.Config[subSecondPrecisionKey]); err != nil {
@@ -134,6 +142,7 @@ func New(info logger.Info) (logger.Logger, error) {
134142
RetryWait: retryWait,
135143
MaxRetry: maxRetries,
136144
Async: asyncConnect,
145+
AsyncStop: asyncStop,
137146
SubSecondPrecision: subSecondPrecision,
138147
}
139148

@@ -199,6 +208,7 @@ func ValidateLogOpt(cfg map[string]string) error {
199208
case retryWaitKey:
200209
case maxRetriesKey:
201210
case asyncConnectKey:
211+
case asyncStopKey:
202212
case subSecondPrecisionKey:
203213
// Accepted
204214
default:

0 commit comments

Comments
 (0)