File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ func DefaultConfig() *Config {
51
51
config .Port = 1233
52
52
config .LogPath = "logs"
53
53
54
- config .LogConfig .LogFile = "app .log"
54
+ config .LogConfig .LogFile = "./logs/log-beetle .log"
55
55
config .LogConfig .MaxSize = 1 // 默认值为 100 MB
56
56
config .LogConfig .MaxBackups = 5 // 默认值为 10
57
57
config .LogConfig .MaxAge = 30 // 默认值为 30 天
Original file line number Diff line number Diff line change 4
4
"github.com/gin-gonic/gin"
5
5
"github.com/reggiepy/LogBeetle/docs"
6
6
"github.com/reggiepy/LogBeetle/middleware"
7
+ "github.com/reggiepy/LogBeetle/pkg/config"
7
8
"github.com/reggiepy/LogBeetle/pkg/logger"
8
9
"github.com/reggiepy/LogBeetle/web/api"
9
10
swaggerFiles "github.com/swaggo/files"
@@ -37,7 +38,11 @@ func SetupRouter() *gin.Engine {
37
38
r .GET ("/log-beetle/v1/ping" , api .PingHandler )
38
39
r .GET ("/log-beetle/v1/about" , api .AboutHandler )
39
40
r .POST ("/log-beetle/v1/send-message" , api .SendMessageHandler )
40
- // use ginSwagger middleware to serve the API docs
41
- r .GET ("/log-beetle/v1/swagger/*any" , ginSwagger .WrapHandler (swaggerFiles .Handler ))
41
+ if config .Instance .Env == "dev" {
42
+ // use ginSwagger middleware to serve the API docs
43
+ r .GET ("/log-beetle/swagger/*any" , ginSwagger .WrapHandler (swaggerFiles .Handler ))
44
+ } else {
45
+ gin .SetMode (gin .ReleaseMode )
46
+ }
42
47
return r
43
48
}
You can’t perform that action at this time.
0 commit comments