Files
new-api/middleware
RedwindA 4193734a2a fix(logger): keep gin access and recovery logs on the current log file after rotation (#8098)
The gin access logger and panic recovery captured gin.DefaultWriter and
gin.DefaultErrorWriter when the server was built. Since log rotation closes
the previous file, every [GIN] access line and [Recovery] stack after the
first rotation reached stdout/stderr only and never any log file.

Both middlewares now write through common.LogWriter / common.ErrorLogWriter,
which forward each write to the current gin writers under LogWriterMu, so
rotation can swap and close files without losing lines or leaking the old fd.
The server-wide recovery moves from main.go to middleware.PanicRecover so the
production wiring is covered by the regression test.
2026-10-30 15:26:58 +08:00
..
2026-10-30 15:01:17 +08:00
2026-10-30 15:01:17 +08:00