Skip to content

Migrate logging to slog #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

panz3r
Copy link
Contributor

@panz3r panz3r commented May 27, 2025

Motivation

This PR migrates the project's logging mechanism to the standard Go slog package.

The main goals are to leverage structured logging capabilities for better log parsing and analysis, improve log formatting, and align with modern Go logging practices without using a third-party external dependency.

Additionally, the Dockerfile is updated to use newer versions of Go and Alpine for improved security and features, in particular to include the slog standard module (available starting from Go 1.21.0).

Description of Changes

  • Refactored the application's logging to use the slog package for improved log formatting and structured logging (2b215d3).
  • Added comprehensive tests for the new logging implementation (eeb1809).
  • Refactored existing tests to utilize slog for their logging output and improved JSON log validation where applicable (477234e).
  • Updated the Dockerfile to use Go 1.24 and Alpine 3.21 (bfa6ed1).

Checklist

  • My code follows the project's style guidelines
  • I have added or updated tests to cover the changes
  • All tests are passing locally
  • CI checks are passing
  • I have reviewed my own code and lock file changes (if any)
  • I have verified the changes work as expected (logging format, Docker build)

Notes for Reviewers

  • The primary change is the migration from the previous logging package (zerolog) to Go's standard slog package. Reviewers should pay attention to the log output format and the refactored tests.
  • The Dockerfile has been updated to Go 1.24 and Alpine 3.21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant