From ad8e3ea5dc0f4ff5dd6e5b17baad611e6b46def7 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 28 Apr 2015 16:29:58 -0400 Subject: [PATCH] etcdmain: fix logging flag documentation --- Documentation/configuration.md | 11 +++++++++++ etcdmain/config.go | 6 +++--- etcdmain/etcd.go | 4 ++-- etcdmain/help.go | 10 ++++++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Documentation/configuration.md b/Documentation/configuration.md index 670efc6cd..f55dc1d2e 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -149,6 +149,17 @@ The security flags help to [build a secure etcd cluster][security]. + Path to the peer server TLS trusted CA file. + 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 Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol. diff --git a/etcdmain/config.go b/etcdmain/config.go index d3848ceb7..3b71aa926 100644 --- a/etcdmain/config.go +++ b/etcdmain/config.go @@ -96,8 +96,8 @@ type config struct { clientTLSInfo, peerTLSInfo transport.TLSInfo // logging - debug bool - logPkgs string + debug bool + logPkgLevels string // unsafe forceNewCluster bool @@ -185,7 +185,7 @@ func NewConfig() *config { // logging 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 fs.BoolVar(&cfg.forceNewCluster, "force-new-cluster", false, "Force to create a new one member cluster") diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index 5b56e47df..26fde6c8b 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -399,9 +399,9 @@ func setupLogging(cfg *config) { if cfg.debug { capnslog.SetGlobalLogLevel(capnslog.DEBUG) } - if cfg.logPkgs != "" { + if cfg.logPkgLevels != "" { repoLog := capnslog.MustRepoLogger("github.com/coreos/etcd") - settings, err := repoLog.ParseLogLevelConfig(cfg.logPkgs) + settings, err := repoLog.ParseLogLevelConfig(cfg.logPkgLevels) if err != nil { log.Warningf("Couldn't parse log level string: %s, continuing with default levels", err.Error()) return diff --git a/etcdmain/help.go b/etcdmain/help.go index ccfe41b77..0676f2d49 100644 --- a/etcdmain/help.go +++ b/etcdmain/help.go @@ -48,7 +48,7 @@ member flags: clustering flags: --initial-advertise-peer-urls 'http://localhost:2380,http://localhost:7001' - list of this member's peer URLs to advertise to the rest of the cluster. + list of this member's peer URLs to advertise to the rest of the cluster. --initial-cluster 'default=http://localhost:2380,default=http://localhost:7001' initial cluster configuration for bootstrapping. --initial-cluster-state 'new' @@ -96,12 +96,18 @@ security flags: --peer-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: Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol. - + --force-new-cluster 'false' force to create a new one-member cluster. `