Skip to content

Commit

Permalink
Merge pull request linkedin#152 from CVTJNII/DockerLogStdout
Browse files Browse the repository at this point in the history
Log to stdout in the Docker container
  • Loading branch information
Todd Palino authored Mar 2, 2017
2 parents 6e01a77 + ff7f09b commit f595168
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type BurrowConfig struct {
ClientID string `gcfg:"client-id"`
GroupBlacklist string `gcfg:"group-blacklist"`
GroupWhitelist string `gcfg:"group-whitelist"`
StdoutLogfile string `gcfg:"stdout-logfile"`
}
Zookeeper struct {
Hosts []string `gcfg:"hostname"`
Expand Down
2 changes: 1 addition & 1 deletion docker-config/logging.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<seelog minlevel="info">
<outputs formatid="main">
<rollingfile type="date" filename="/var/tmp/burrow/burrow.log" datepattern="2006-01-02" maxrolls="7" />
<console />
</outputs>
<formats>
<format id="main" format="%Date(2006-01-02 15:04:05) [%LEVEL] %Msg%n"/>
Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ func burrowMain() int {
createPidFile(appContext.Config.General.LogDir + "/" + appContext.Config.General.PIDFile)
defer removePidFile(appContext.Config.General.LogDir + "/" + appContext.Config.General.PIDFile)

// Set up stderr/stdout to go to a separate log file
openOutLog(appContext.Config.General.LogDir + "/burrow.out")
// Set up stderr/stdout to go to a separate log file, if enabled
if appContext.Config.General.StdoutLogfile != "" {
openOutLog(appContext.Config.General.LogDir + "/" + appContext.Config.General.StdoutLogfile)
}
fmt.Println("Started Burrow at", time.Now().Format("January 2, 2006 at 3:04pm (MST)"))

// If a logging config is specified, replace the existing loggers
Expand Down

0 comments on commit f595168

Please sign in to comment.