influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
29.05k stars 3.56k forks source link

[Feature request] Add logfile in influxdb.conf to specify log file location #7678

Closed wei-hai closed 7 years ago

wei-hai commented 7 years ago

Proposal: Add logfile in influxdb.conf to specify log file location like that in telegraf Current behavior: The latest version writes log via systemd journal Desired behavior: Provide an option to use the old way for logging Use case: We use Telegraf's plugin tail and logparser to find error message from influxdb's log file and they cannot work with journalctl, so it would be flexible to provide an option to explicitly specify where the log file is.

jsternberg commented 7 years ago

It might be most appropriate to do this as part of the change to structured logging that's being done in #7036.

The initial PR for that won't do what this issue is requesting, but it's a very small step to add that functionality afterward.

e-dard commented 7 years ago

I'm 👎 on adding functionality to log to files. I don't think the database should be concerning itself with that. If it's necessary to redirect database logs to file(s) then using shell redirection and/or tools like tee seems like the best way to do this.

pauldix commented 7 years ago

Does the information on this page give a good answer for how to work with the InfluxDB output in log files? https://docs.influxdata.com/influxdb/v1.2/administration/logs/