🎨 更新日志格式,添加IP地址到请求日志中
All checks were successful
BuildImage / build-image (push) Successful in 4m1s

This commit is contained in:
李寻欢 2025-04-08 14:35:19 +08:00
parent 590b48f925
commit 5247077479

View File

@ -118,7 +118,7 @@ func New(cfg *config.Config) *Server {
// 注册中间件 // 注册中间件
app.Use(recover.New()) app.Use(recover.New())
app.Use(logger.New(logger.Config{ app.Use(logger.New(logger.Config{
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n", Format: "[${time}] ${status} - ${ip} - ${latency} ${method} ${path}\n",
TimeFormat: "2006-01-02 15:04:05", TimeFormat: "2006-01-02 15:04:05",
})) }))
app.Use(cors.New()) app.Use(cors.New())