Default logtarget to file for backwards compatibility (#6555)
This commit is contained in:
parent
d8c8458e1e
commit
b3f20f69f5
|
@ -144,11 +144,14 @@ The agent table configures Telegraf and the defaults used across all plugins.
|
||||||
Log only error level messages.
|
Log only error level messages.
|
||||||
|
|
||||||
- **logtarget**:
|
- **logtarget**:
|
||||||
Log target - `file`, `stderr` or `eventlog` (Windows only).
|
Log target controls the destination for logs and can be one of "file",
|
||||||
The empty string means to log to stderr.
|
"stderr" or, on Windows, "eventlog". When set to "file", the output file is
|
||||||
|
determined by the "logfile" setting.
|
||||||
|
|
||||||
- **logfile**:
|
- **logfile**:
|
||||||
Log file name.
|
Name of the file to be logged to when using the "file" logtarget. If set to
|
||||||
|
the empty string then logs are written to stderr.
|
||||||
|
|
||||||
|
|
||||||
- **logfile_rotation_interval**:
|
- **logfile_rotation_interval**:
|
||||||
The logfile will be rotated after the time interval specified. When set to
|
The logfile will be rotated after the time interval specified. When set to
|
||||||
|
|
|
@ -75,6 +75,7 @@ func NewConfig() *Config {
|
||||||
Interval: internal.Duration{Duration: 10 * time.Second},
|
Interval: internal.Duration{Duration: 10 * time.Second},
|
||||||
RoundInterval: true,
|
RoundInterval: true,
|
||||||
FlushInterval: internal.Duration{Duration: 10 * time.Second},
|
FlushInterval: internal.Duration{Duration: 10 * time.Second},
|
||||||
|
LogTarget: "file",
|
||||||
LogfileRotationMaxArchives: 5,
|
LogfileRotationMaxArchives: 5,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -146,10 +147,13 @@ type AgentConfig struct {
|
||||||
// Quiet is the option for running in quiet mode
|
// Quiet is the option for running in quiet mode
|
||||||
Quiet bool `toml:"quiet"`
|
Quiet bool `toml:"quiet"`
|
||||||
|
|
||||||
// Log target - file, stderr, eventlog (Windows only). The empty string means to log to stderr.
|
// Log target controls the destination for logs and can be one of "file",
|
||||||
|
// "stderr" or, on Windows, "eventlog". When set to "file", the output file
|
||||||
|
// is determined by the "logfile" setting.
|
||||||
LogTarget string `toml:"logtarget"`
|
LogTarget string `toml:"logtarget"`
|
||||||
|
|
||||||
// Log file name .
|
// Name of the file to be logged to when using the "file" logtarget. If set to
|
||||||
|
// the empty string then logs are written to stderr.
|
||||||
Logfile string `toml:"logfile"`
|
Logfile string `toml:"logfile"`
|
||||||
|
|
||||||
// The file will be rotated after the time interval specified. When set
|
// The file will be rotated after the time interval specified. When set
|
||||||
|
@ -290,7 +294,13 @@ var agentConfig = `
|
||||||
## Log only error level messages.
|
## Log only error level messages.
|
||||||
# quiet = false
|
# quiet = false
|
||||||
|
|
||||||
## Log file name, the empty string means to log to stderr.
|
## Log target controls the destination for logs and can be one of "file",
|
||||||
|
## "stderr" or, on Windows, "eventlog". When set to "file", the output file
|
||||||
|
## is determined by the "logfile" setting.
|
||||||
|
# logtarget = "file"
|
||||||
|
|
||||||
|
## Name of the file to be logged to when using the "file" logtarget. If set to
|
||||||
|
## the empty string then logs are written to stderr.
|
||||||
# logfile = ""
|
# logfile = ""
|
||||||
|
|
||||||
## The logfile will be rotated after the time interval specified. When set
|
## The logfile will be rotated after the time interval specified. When set
|
||||||
|
|
Loading…
Reference in New Issue