0

On Debian, my Influxdb2 v2.6 instance runs with systemd and writes the logs to stdout. But I want to send the logs to a dedicated logfile like /path/to/influxdb.log.

How can I change this behavior? The Docs says, I have to change the startup parameter to influxd 1> /path/to/influxdb.log. But where is this config located? I assume somewhere inside the /usr/lib/influxdb/scripts/influxd-systemd-start.sh file.

Gill-Bates
  • 585
  • 2
  • 8
  • 23

1 Answers1

0

I have found the solution!

First, create an empty Logfile with proper Permissions:

touch /path/to/influxdb.log
chown influxdb /path/to/influxdb.log

Second, modify the the startup script. Inside the file /usr/lib/influxdb/scripts/influxd-systemd-start.sh the first line has to change to:

/usr/bin/influxd 1> /path/to/influxdb.log &

Furthermore, it should be ensured that the following entries are present in /etc/influxdb/config.toml:

log-level = "info"

After restarting the service, the logs are where they should be.

Gill-Bates
  • 585
  • 2
  • 8
  • 23