Skip to content

Commit 6ff7126

Browse files
committed
More docs
1 parent 0f3b629 commit 6ff7126

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

modules/logging/filewriter.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,19 @@ type FileWriter struct {
9999
RollSizeMB int `json:"roll_size_mb,omitempty"`
100100

101101
// Roll log file after some time
102-
RollInterval time.Duration `json:"roll_interval,omitempty`
102+
RollInterval time.Duration `json:"roll_interval,omitempty"`
103103

104104
// 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"`
106109

107110
// 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"`
109115

110116
// Whether to compress rolled files. Default: true
111117
RollCompress *bool `json:"roll_gzip,omitempty"`
@@ -122,6 +128,8 @@ type FileWriter struct {
122128
RollKeepDays int `json:"roll_keep_days,omitempty"`
123129

124130
// 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
125133
BackupTimeFormat string `json:"backup_time_format,omitempty"`
126134
}
127135

0 commit comments

Comments
 (0)