mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdmain: fix logging flag documentation
This commit is contained in:
parent
2299e35d99
commit
ad8e3ea5dc
@ -149,6 +149,17 @@ The security flags help to [build a secure etcd cluster][security].
|
|||||||
+ Path to the peer server TLS trusted CA file.
|
+ Path to the peer server TLS trusted CA file.
|
||||||
+ default: none
|
+ default: none
|
||||||
|
|
||||||
|
### Logging Flags
|
||||||
|
|
||||||
|
##### -debug
|
||||||
|
+ Drop the default log level to DEBUG for all subpackages.
|
||||||
|
+ default: false (INFO for all packages)
|
||||||
|
|
||||||
|
##### -log-package-levels
|
||||||
|
+ Set individual etcd subpackages to specific log levels. An example being `etcdserver=WARNING,security=DEBUG`
|
||||||
|
+ default: none (INFO for all packages)
|
||||||
|
|
||||||
|
|
||||||
### Unsafe Flags
|
### Unsafe Flags
|
||||||
|
|
||||||
Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol.
|
Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol.
|
||||||
|
@ -97,7 +97,7 @@ type config struct {
|
|||||||
|
|
||||||
// logging
|
// logging
|
||||||
debug bool
|
debug bool
|
||||||
logPkgs string
|
logPkgLevels string
|
||||||
|
|
||||||
// unsafe
|
// unsafe
|
||||||
forceNewCluster bool
|
forceNewCluster bool
|
||||||
@ -185,7 +185,7 @@ func NewConfig() *config {
|
|||||||
|
|
||||||
// logging
|
// logging
|
||||||
fs.BoolVar(&cfg.debug, "debug", false, "Enable debug output to the logs.")
|
fs.BoolVar(&cfg.debug, "debug", false, "Enable debug output to the logs.")
|
||||||
fs.StringVar(&cfg.logPkgs, "log-packages", "", "Specify a particular log level for each etcd package.")
|
fs.StringVar(&cfg.logPkgLevels, "log-package-levels", "", "Specify a particular log level for each etcd package.")
|
||||||
|
|
||||||
// unsafe
|
// unsafe
|
||||||
fs.BoolVar(&cfg.forceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster")
|
fs.BoolVar(&cfg.forceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster")
|
||||||
|
@ -399,9 +399,9 @@ func setupLogging(cfg *config) {
|
|||||||
if cfg.debug {
|
if cfg.debug {
|
||||||
capnslog.SetGlobalLogLevel(capnslog.DEBUG)
|
capnslog.SetGlobalLogLevel(capnslog.DEBUG)
|
||||||
}
|
}
|
||||||
if cfg.logPkgs != "" {
|
if cfg.logPkgLevels != "" {
|
||||||
repoLog := capnslog.MustRepoLogger("github.com/coreos/etcd")
|
repoLog := capnslog.MustRepoLogger("github.com/coreos/etcd")
|
||||||
settings, err := repoLog.ParseLogLevelConfig(cfg.logPkgs)
|
settings, err := repoLog.ParseLogLevelConfig(cfg.logPkgLevels)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("Couldn't parse log level string: %s, continuing with default levels", err.Error())
|
log.Warningf("Couldn't parse log level string: %s, continuing with default levels", err.Error())
|
||||||
return
|
return
|
||||||
|
@ -96,6 +96,12 @@ security flags:
|
|||||||
--peer-trusted-ca-file ''
|
--peer-trusted-ca-file ''
|
||||||
path to the peer server TLS trusted CA file.
|
path to the peer server TLS trusted CA file.
|
||||||
|
|
||||||
|
logging flags
|
||||||
|
|
||||||
|
--debug 'false'
|
||||||
|
enable debug-level logging for etcd.
|
||||||
|
--log-package-levels ''
|
||||||
|
set individual packages to various log levels (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG')
|
||||||
|
|
||||||
unsafe flags:
|
unsafe flags:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user