-
Start a telegraf playground: https://rootnroll.com/d/telegraf/
-
Edit /etc/telegraf/telegraf.conf to modify the config as follows:
Logging configuration:
Run telegraf with debug log messages.
debug = true
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 = "/etc/log.log"
- Run telegraf --test
2019-10-19T09:50:11Z I! Starting Telegraf 1.10.2
2019-10-19T09:50:11Z I! Using config file: /etc/telegraf/telegraf.conf
2019-10-19T09:50:11Z E! Unable to open /etc/log.log (open /etc/log.log: permission denied), using stderr
- Unable to even execute
touch /etc/log.log
Need to do
sudo touch /etc/log.log to create the file
- Even after file is created, the log file does not get appended. Probably need a sudo append/write to make it work