You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ The agent table configures Telegraf and the defaults used across all plugins.
147
147
The log file max [size][]. Log files will be rotated when they exceed this size. Default is 0 => no rotation based on file size.
148
148
-**logfile_rotation_max_archives**:
149
149
Maximum number of archives (rotated) files to keep. Older log files are deleted first.
150
-
This setting is only applicable if MaxAge and/or MaxSize settings have been specified (otherwise there is no rotation)
150
+
This setting is only applicable if `logfile_rotation_interval` and/or `logfile_rotation_max_size` settings have been specified (otherwise there is no rotation)
151
151
Default is 0 => all rotated files are deleted. Use -1 to keep all archives.
Copy file name to clipboardExpand all lines: internal/config/config.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -288,7 +288,7 @@ var agentConfig = `
288
288
## The log file max size. Log files will be rotated when they exceed this size. Default is 0 => no rotation based on file size.
289
289
# logfile_rotation_max_size = "10 MB"
290
290
## Maximum number of archives (rotated) files to keep. Older log files are deleted first.
291
-
## This setting is only applicable if MaxAge and/or MaxSize settings have been specified (otherwise there is no rotation)
291
+
## This setting is only applicable if logfile_rotation_interval and/or logfile_rotation_max_size settings have been specified (otherwise there is no rotation)
292
292
## Default is 0 => all rotated files are deleted.
293
293
## Use -1 to keep all archives.
294
294
## Analogous to logrotate "rotate" setting http://man7.org/linux/man-pages/man8/logrotate.8.html
// Goal here is to rotate old pre-existing files. For that we use fileInfo.ModTime, instead of time.Now(), only when the FileWriter is created (firstRun)
117
-
// Example: telegraf is restarted every 23 hours and the rotation interval is set to 24 hours. With time.now() as a reference we'd never rotate the file.
118
-
// It's only necessary to use modtime when the filewriter is created, otherwise we assume that we've been continuously running, so time.now is fine.
118
+
// Goal here is to rotate old pre-existing files.
119
+
// For that we use fileInfo.ModTime, instead of time.Now().
120
+
// Example: telegraf is restarted every 23 hours and
121
+
// the rotation interval is set to 24 hours.
122
+
// With time.now() as a reference we'd never rotate the file.
0 commit comments