[bugfix] LogOpts doesn't take effect in pouchd config file #2938
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Configure LogOpts in /etc/pouch/config.json such as:
"default-log-config": {
"Type": "json-file",
"Config": {
"max-file": "5",
"max-size": "300m"
}
}
"max-file" and "max-size" are log options for pouchd.
We create a container which will set its log options from pouchd.
However, it doesn't take effect.
This patch will fix it. Config file and cmd flags will be merged.
So we should set LogOpts from cmd flags "--log-opt" before merging.
Signed-off-by: baijia.wr baijia.wr@antfin.com
Ⅰ. Describe what this PR did
We set log options in config file of pouchd(/etc/pouch/config.json) such as
"default-log-config": {
"Type": "json-file",
"Config": {
"max-file": "5",
"max-size": "300m"
}
}
It doesn't take effect because cfg.DefaultLogConfig.LogOpts is reset to logOpts which comes from --log-opt in cmd flag.
This patch will fix it.
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews