We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd21f14 commit 5b73b68Copy full SHA for 5b73b68
2 files changed
bootstrap/log.go
@@ -22,7 +22,7 @@ func Log() {
22
FullTimestamp: true,
23
})
24
logConfig := conf.Conf.Log
25
- if !args.Debug && logConfig.Path != "" {
+ if logConfig.Enable {
26
var (
27
writer *rotatelogs.RotateLogs
28
err error
conf/config.go
@@ -24,6 +24,7 @@ type CacheConfig struct {
}
type LogConfig struct {
+ Enable bool `json:"enable" env:"log_enable"`
Path string `json:"path" env:"LOG_PATH"`
29
Name string `json:"name" env:"LOG_NAME"`
30
RotationTime uint `json:"rotation_time" env:"LOG_TIME"`
@@ -59,6 +60,7 @@ func DefaultConfig() *Config {
59
60
CleanupInterval: 120,
61
},
62
Log: LogConfig{
63
+ Enable: true,
64
Path: "log/%Y-%m-%d-%H:%M.log",
65
Name: "log/log.log",
66
RotationTime: 24,
0 commit comments