Logs

This is archived documentation for InfluxData product versions that are no longer maintained. For newer documentation, see the latest InfluxData documentation.

InfluxDB writes log output, by default, to stderr. Depending on your use case, this log information can be written to another location. Some service managers may override this default.

Running InfluxDB directly

If you run InfluxDB directly, using influxd, all logs will be written to stderr. You may redirect this log output as you would any output to stderr like so:

influxdb-meta 2>$HOME/my_log_file # Meta nodes
influxd 2>$HOME/my_log_file # Data nodes
influx-enterprise 2>$HOME/my_log_file # Enterprise Web 

Launched as a service

sysvinit

If InfluxDB was installed using a pre-built package, and then launched as a service, stderr is redirected to /var/log/influxdb/<node-type>.log, and all log data will be written to that file. You can override this location by setting the variable STDERR in the file /etc/default/<node-type>.

For example, if on a data node /etc/default/influxdb contains:

STDERR=/dev/null

all log data will be discarded. You can similarly direct output to stdout by setting STDOUT in the same file. Output to stdout is sent to /dev/null by default when InfluxDB is launched as a service.

InfluxDB must be restarted to pick up any changes to /etc/default/<node-type>.

Meta Nodes

For meta nodes the is influxdb-meta. The default log file is /var/log/influxdb/influxdb-meta.log The service configuration file is /etc/default/influxdb-meta.

Data Nodes

For data nodes the is influxdb. The default log file is /var/log/influxdb/influxdb.log The service configuration file is /etc/default/influxdb.

Enterprise Web

For Enterprise Web nodes the is influx-enterprise. The default log file is /var/log/influxdb/influx-enterprise.log The service configuration file is /etc/default/influx-enterprise.

systemd

Starting with version 1.0, InfluxDB on systemd systems no longer writes files to /var/log/<node-type>.log by default, and now uses the system configured default for logging (usually journald). On most systems, the logs will be directed to the systemd journal and can be accessed with the command:

sudo journalctl -u <node-type>.service

Please consult the systemd journald documentation for configuring journald.

Meta Nodes

For data nodes the is influxdb-meta. The default log command is sudo journalctl -u influxdb-meta.service The service configuration file is /etc/default/influxdb-meta.

Data Nodes

For data nodes the is influxdb. The default log command is sudo journalctl -u influxdb.service The service configuration file is /etc/default/influxdb.

Enterprise Web

For data nodes the is influx-enterprise. The default log command is sudo journalctl -u influx-enterprise.service The service configuration file is /etc/default/influx-enterprise.

Using logrotate

You can use logrotate to rotate the log files generated by InfluxDB on systems where logs are written to flat files. If using the package install on a sysvinit system, the config file for logrotate is installed in /etc/logrotate.d. You can view the file here.