Abstract
The `log/slog` package has been part of the standard library since v1.21 (Aug 2023). Yet, many Go projects are still scratching the surface of its potential. Are you truly making use of all its features?
This talk moves beyond the basics of `Logger` and `Handler` to explore how `slog` transforms logging from a tedious chore into a powerful, maintainable, and testable system. We’ll quickly review `slog`'s robust stack, then dive deep into practical, production-ready patterns:
- Contextual Logging: Implement patterns for seamless, idiomatic contextual logging that enriches every log line without cumbersome boilerplate.
- Secure Logging & Data Masking: Implement robust strategies to prevent sensitive information from accidentally leaking into your production logs.
- Testing and Coverage: Discover techniques to add high code coverage and unit-test your logging stack to help ensure your logs are correct and concise before they ever hit production.
- Bridging the Gap: Learn how to integrate `slog` with existing logging libraries and ecosystems for a smooth migration or interoperability.
Attendees will leave this session equipped with a comprehensive collection of patterns and techniques for utilizing the powerful `slog` library, armed to make it their preferred choice for logging.