We are fintech company based on Japan! Payment solution for business 2+ years Gopher Nomad worker ✈ Around the world with my Gopher, which I got in KubeCon EU😂 2 Pyramids with my gopher in Egypt
categorise logs by severity. From debug to info, warning, and error. We can also add your own log levels. Structured Logging Ability to log structured data (e.g., JSON or key-value pairs) for easier parsing and analysis. Support Text and JSON as build-in. Common Log Attributes Support for add common information for each log entry. 8
way to create your own log implementation • Needed when standard handlers don't meet your needs For example, ◦ Output logs in a custom format other than Text and JSON ◦ Control conditions for log output (e.g. asynchronously) …and more cases that slog doesn't support! 13
• Consider what fields are needed to implement your handler • Log destination? • Any option for format/output? • Any other state to format/output Record? • Implement Handler interface 17
impact on systems Any ideas for logging…? 💡 …and more. 20 Notify log to other services! 💬 Slack/Teams, or any other chat app, even posting on X 😂 Change behaviour by time ⏰ For critical periods, such as peak hours or maintenance windows. Output only spiked logs ⚡ To reduce noise and focus on important events
to cover all cases, including testing. • Even custom handlers can benefit from slog's performance optimisation. • Consider wrappers/existing libs before building custom handlers. • Understanding handlers helps when adopting slog. 24
Handlers Wrapper Handlers Custom Handlers Implementation Effort None 🤗 Low 😌 High 🤓 Output Formatting Text/JSON format Some customization via wrapping Complete control over formatting Output Destination io.Writer Varies depends on wrapper implementation Custom destinations possible Performance Good out-of-box performance Moderate additional layers can impact performance Varies depends on implementation, but can be optimized for specific needs Integration Limited external integration Some integration via wrapping Integrate any external Conditionals/Filtering Basic Some filtering via wrapping Custom filters/deduplication