logger: Database.Trace() is a no output — SQL trace logging silently swallowed
- Dominant language
- Go
- Stars
- 223
- Forks
- 225
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 1
Description
## Problem
Database.Trace() at logger/database.go:41 has an empty method body:
func (c *Database) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) {
}
When GORM calls Trace after executing a SQL query, the SQL string, execution time, row count, and any error are silently discarded with no logging output.
## Impact
- All trace-level database logging is lost
- No visibility into slow queries or query errors via the logger
- Contradicts the pattern of Info, Warn, and Error in the same file which all forward to the underlying logger
Contributor guide
Research direction
Start in logger/database.go at Database.Trace(), then compare the Info, Warn, and Error methods in the same file to understand how they forward messages to the underlying logger. Confirm the GORM trace inputs are represented in the output and verify that SQL, timing, row count, and errors are no longer silently discarded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 76/100