Skip to content

Commit

Permalink
[FAB-3390] Override log level - cauthdsl and policies
Browse files Browse the repository at this point in the history
This CR adds the ability to override the log levels for the `cauthdsl`
and `policies` loggers as they generate a large amount of output.

Change-Id: Ib4ef569f13a8b7a93447d8f58c7f24f9626cc738
Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
  • Loading branch information
wlahti committed Apr 26, 2017
1 parent 01aa829 commit b5f9f0a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/policies/policy.go
Expand Up @@ -60,7 +60,7 @@ const (
BlockValidation = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + "BlockValidation"
)

var logger = flogging.MustGetLogger("common/policies")
var logger = flogging.MustGetLogger("policies")

// Policy is used to determine if a signature is valid
type Policy interface {
Expand Down
2 changes: 1 addition & 1 deletion peer/node/start.go
Expand Up @@ -266,7 +266,7 @@ func serve(args []string) error {

// set the logging level for specific modules defined via environment
// variables or core.yaml
overrideLogModules := []string{"msp", "gossip", "ledger"}
overrideLogModules := []string{"msp", "gossip", "ledger", "cauthdsl", "policies"}
for _, module := range overrideLogModules {
err = common.SetLogLevelFromViper(module)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion sampleconfig/core.yaml
Expand Up @@ -26,9 +26,11 @@ logging:
peer: info

# Override levels for various 'peer' modules
cauthdsl: warning
gossip: warning
ledger: info
msp: warning
policies: warning

# Error handling framework log level - when set to DEBUG, a callstack will
# be appended to all errors generated using the fabric/common/errors package
Expand Down Expand Up @@ -204,7 +206,7 @@ peer:
# establishing TLS connection
rootcert:
file: peer/tls.crt

# The server name use to verify the hostname returned by TLS handshake
serverhostoverride:

Expand Down

0 comments on commit b5f9f0a

Please sign in to comment.