Skip to content

Commit

Permalink
Add deploymentID to web handler logs (minio#7712)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisis authored and kannappanr committed Jun 3, 2019
1 parent 0cfd5a2 commit 74efbb4
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 140 deletions.
9 changes: 7 additions & 2 deletions cmd/logger/target/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ func (c *Target) Send(e interface{}) error {
apiString += ")"
timeString := "Time: " + time.Now().Format(logger.TimeFormat)

var deploymentID string
if entry.DeploymentID != "" {
deploymentID = "\nDeploymentID: " + entry.DeploymentID
}

var requestID string
if entry.RequestID != "" {
requestID = "\nRequestID: " + entry.RequestID
Expand All @@ -94,8 +99,8 @@ func (c *Target) Send(e interface{}) error {
}

var msg = logger.ColorFgRed(logger.ColorBold(entry.Trace.Message))
var output = fmt.Sprintf("\n%s\n%s%s%s%s\nError: %s%s\n%s",
apiString, timeString, requestID, remoteHost, userAgent,
var output = fmt.Sprintf("\n%s\n%s%s%s%s%s\nError: %s%s\n%s",
apiString, timeString, deploymentID, requestID, remoteHost, userAgent,
msg, tagString, strings.Join(trace, "\n"))

fmt.Println(output)
Expand Down
Loading

0 comments on commit 74efbb4

Please sign in to comment.