Skip to content

Commit

Permalink
Merge pull request #105 from fasaxc/log-to-stdout
Browse files Browse the repository at this point in the history
Log to stdout
  • Loading branch information
Neil Jerram authored and fasaxc committed Jan 11, 2018
1 parent 43a9a0d commit d20c0c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/logutils/logutils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016-2017 Tigera, Inc. All rights reserved.
// Copyright (c) 2016-2018 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -58,6 +58,9 @@ const logQueueSize = 100
// if it is enabled by either the TYPHA_EARLYLOGSEVERITYSCREEN or TYPHA_LOGSEVERITYSCREEN
// environment variable.
func ConfigureEarlyLogging() {
// Log to stdout. This prevents fluentd, for example, from interpreting all our logs as errors by default.
log.SetOutput(os.Stdout)

// Replace logrus' formatter with a custom one using our time format,
// shared with the Python code.
log.SetFormatter(&Formatter{})
Expand Down Expand Up @@ -115,7 +118,7 @@ func ConfigureLogging(configParams *config.Config) {
if configParams.LogSeverityScreen != "" {
screenDest := NewStreamDestination(
logLevelScreen,
os.Stderr,
os.Stdout,
make(chan QueuedLog, logQueueSize),
configParams.DebugDisableLogDropping,
)
Expand Down

0 comments on commit d20c0c9

Please sign in to comment.