Always use structured logging with appropriate tags instead of string concatenation or formatting. Include relevant contextual information that would help in troubleshooting, such as namespace, operation ID, or workflow ID.
Always use structured logging with appropriate tags instead of string concatenation or formatting. Include relevant contextual information that would help in troubleshooting, such as namespace, operation ID, or workflow ID.
Instead of this:
logger.Debug("ShowTaskQueueConfig : " + strconv.FormatBool(req.ShowTaskQueueConfig))
logger.Info(fmt.Sprintf("Removed expired workflow rule %s", oldestKey))
Do this:
logger.Debug("Show task queue config", tag.Bool("showTaskQueueConfig", req.ShowTaskQueueConfig))
logger.Info("Removed expired workflow rule", tag.WorkflowRuleID(oldestKey), tag.WorkflowNamespaceID(namespaceID))
Structured logging with proper context tags makes logs:
Always consider what contextual information would be helpful for someone debugging an issue, and include those as tags rather than embedding them in the message text.
Enter the URL of a public GitHub repository