Log messages should be descriptive, contextual, and provide actionable information. Include relevant context such as service names, configuration details, or affected components. When logging errors or warnings, explain what happened, why it matters, and what action is being taken or should be taken.
Log messages should be descriptive, contextual, and provide actionable information. Include relevant context such as service names, configuration details, or affected components. When logging errors or warnings, explain what happened, why it matters, and what action is being taken or should be taken.
Examples of improvements:
logger.Error().Msg("Health check interval smaller than zero")
Use: logger.Error().Msg("Health check interval smaller than zero, default value will be used instead.")
This approach helps with debugging, monitoring, and provides users with clear understanding of system behavior and any corrective actions being taken.
Enter the URL of a public GitHub repository