@@ -99,13 +99,19 @@ type FileWriter struct {
99
99
RollSizeMB int `json:"roll_size_mb,omitempty"`
100
100
101
101
// Roll log file after some time
102
- RollInterval time.Duration `json:"roll_interval,omitempty`
102
+ RollInterval time.Duration `json:"roll_interval,omitempty" `
103
103
104
104
// Roll log file at fix minutes
105
- RollAtMinutes []int `json:"roll_minutes,omitempty`
105
+ // For example []int{0, 30} will roll file at xx:00 and xx:30 each hour
106
+ // Invalid value are ignored with a warning on stderr
107
+ // See https://github.com/DeRuina/timberjack#%EF%B8%8F-rotation-notes--warnings for caveats
108
+ RollAtMinutes []int `json:"roll_minutes,omitempty"`
106
109
107
110
// Roll log file at fix time
108
- RollAt []string `json:"roll_at,omitempty`
111
+ // For example []string{"00:00", "12:00"} will roll file at 00:00 and 12:00 each day
112
+ // Invalid value are ignored with a warning on stderr
113
+ // See https://github.com/DeRuina/timberjack#%EF%B8%8F-rotation-notes--warnings for caveats
114
+ RollAt []string `json:"roll_at,omitempty"`
109
115
110
116
// Whether to compress rolled files. Default: true
111
117
RollCompress * bool `json:"roll_gzip,omitempty"`
@@ -122,6 +128,8 @@ type FileWriter struct {
122
128
RollKeepDays int `json:"roll_keep_days,omitempty"`
123
129
124
130
// Rotated file will have format <logfilename>-<format>-<criterion>.log
131
+ // Optional. If unset or invalid, defaults to 2006-01-02T15-04-05.000 (with fallback warning)
132
+ // <format> must be a Go time compatible format, see https://pkg.go.dev/time#pkg-constants
125
133
BackupTimeFormat string `json:"backup_time_format,omitempty"`
126
134
}
127
135
0 commit comments