Skip to content

Commit

Permalink
Add note to configuration about when log rotation occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed Jul 31, 2019
1 parent dc292b7 commit 28f1bdb
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
50 changes: 39 additions & 11 deletions etc/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
# logfile = ""

## The logfile will be rotated after the time interval specified. When set
## to 0 no time based rotation is performed.
## to 0 no time based rotation is performed. Logs are rotated only when
## written to, if there is no log activity rotation may be delayed.
# logfile_rotation_interval = "0d"

## The logfile will be rotated when it becomes larger than the specified
Expand Down Expand Up @@ -110,6 +111,9 @@
## tag is not set the 'database' option is used as the default.
# database_tag = ""

## If true, the database tag will not be added to the metric.
# exclude_database_tag = false

## If true, no CREATE DATABASE queries will be sent. Set to true when using
## Telegraf with a user without permissions to create databases or when the
## database already exists.
Expand Down Expand Up @@ -653,6 +657,9 @@
# ## tag is not set the 'bucket' option is used as the default.
# # bucket_tag = ""
#
# ## If true, the bucket tag will not be added to the metric.
# # exclude_bucket_tag = false
#
# ## Timeout for HTTP messages.
# # timeout = "5s"
#
Expand Down Expand Up @@ -2277,6 +2284,11 @@
# # insecure_skip_verify = false


# # Example go-plugin for Telegraf
# [[inputs.example]]
# value = 42


# # Read metrics from one or more commands that can output to stdout
# [[inputs.exec]]
# ## Commands array
Expand Down Expand Up @@ -4308,6 +4320,19 @@
# thread_as_tag = false


# # Read uWSGI metrics.
# [[inputs.uwsgi]]
# ## List with urls of uWSGI Stats servers. URL must match pattern:
# ## scheme://address[:port]
# ##
# ## For example:
# ## servers = ["tcp://localhost:5050", "http://localhost:1717", "unix:///tmp/statsock"]
# servers = ["tcp://127.0.0.1:1717"]
#
# ## General connection timout
# # timeout = "5s"


# # A plugin to collect stats from Varnish HTTP Cache
# [[inputs.varnish]]
# ## If running as a restricted user you can prepend sudo for additional access:
Expand Down Expand Up @@ -4897,21 +4922,22 @@
# str_as_tags = false


# # Read metrics from Kafka topic(s)
# # Read metrics from Kafka topics
# [[inputs.kafka_consumer]]
# ## kafka servers
# ## Kafka brokers.
# brokers = ["localhost:9092"]
# ## topic(s) to consume
#
# ## Topics to consume.
# topics = ["telegraf"]
# ## Add topic as tag if topic_tag is not empty
#
# ## When set this tag will be added to all metrics with the topic as the value.
# # topic_tag = ""
#
# ## Optional Client id
# # client_id = "Telegraf"
#
# ## Set the minimal supported Kafka version. Setting this enables the use of new
# ## Kafka features and APIs. Of particular interest, lz4 compression
# ## requires at least version 0.10.0.0.
# ## Kafka features and APIs. Must be 0.10.2.0 or greater.
# ## ex: version = "1.1.0"
# # version = ""
#
Expand All @@ -4926,10 +4952,12 @@
# # sasl_username = "kafka"
# # sasl_password = "secret"
#
# ## the name of the consumer group
# consumer_group = "telegraf_metrics_consumers"
# ## Offset (must be either "oldest" or "newest")
# offset = "oldest"
# ## Name of the consumer group.
# # consumer_group = "telegraf_metrics_consumers"
#
# ## Initial offset position; one of "oldest" or "newest".
# # offset = "oldest"
#
# ## Maximum length of a message to consume, in bytes (default 0/unlimited);
# ## larger messages are dropped
# max_message_len = 1000000
Expand Down
17 changes: 9 additions & 8 deletions etc/telegraf_windows.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,17 @@
## Valid time units are "ns", "us" (or "µs"), "ms", "s".
precision = ""

## Logging configuration:
## Run telegraf with debug log messages.
debug = false
## Run telegraf in quiet mode (error log messages only).
quiet = false
## Specify the log file name. The empty string means to log to stderr.
logfile = "/Program Files/Telegraf/telegraf.log"
## Log at debug level.
# debug = false
## Log only error level messages.
# quiet = false

## Log file name, the empty string means to log to stderr.
# logfile = ""

## The logfile will be rotated after the time interval specified. When set
## to 0 no time based rotation is performed.
## to 0 no time based rotation is performed. Logs are rotated only when
## written to, if there is no log activity rotation may be delayed.
# logfile_rotation_interval = "0d"

## The logfile will be rotated when it becomes larger than the specified
Expand Down
3 changes: 2 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ var agentConfig = `
# logfile = ""
## The logfile will be rotated after the time interval specified. When set
## to 0 no time based rotation is performed.
## to 0 no time based rotation is performed. Logs are rotated only when
## written to, if there is no log activity rotation may be delayed.
# logfile_rotation_interval = "0d"
## The logfile will be rotated when it becomes larger than the specified
Expand Down

0 comments on commit 28f1bdb

Please sign in to comment.