mirror of
https://github.com/therealpaulgg/ssh-sync-server.git
synced 2026-04-25 07:35:49 +03:00
[GH-ISSUE #38] Add debug logging to API endpoints #8
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ssh-sync-server#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @therealpaulgg on GitHub (Feb 27, 2026).
Original GitHub issue: https://github.com/therealpaulgg/ssh-sync-server/issues/38
Summary
Add structured debug logging throughout the API endpoint handlers to aid in tracing request flow and diagnosing issues in development/staging environments. The logging should use the existing
zerologlogger (github.com/rs/zerolog/log) already present in the project.Motivation
Currently, error paths log via
log.Err(err).Msg(...)but request lifecycle events (incoming requests, parsed parameters, key validation steps, DB operations, etc.) are not logged at the debug level. This makes it harder to trace what's happening without attaching a debugger.Example
pkg/web/router/routes/setup.go—initialSetuphandler — is a good reference for where debug logs would be useful:Scope
pkg/web/router/routes/log.Debug()(notlog.Info()) so logs are silent in production by defaultlog.Err(err).Msg(...)style for consistency