agrif / OctoPrint-InfluxDB

Writes temperatures and events to an Influx database.
GNU Affero General Public License v3.0
24 stars 15 forks source link

If InfluxDB has a full disk, plugin writes hundreds of MB of log files to octoprint.log per day #23

Closed ventilator closed 1 year ago

ventilator commented 3 years ago

Hi,

my InfluxDB refused to accept new data (which is my fault and ignored for a couple of days), and then octoprint complaints about no disk space left. As it turn out, the error logging kind of stuffed my octoprint installation. A suggestion: Maybe just log once a day the error instead every second or so, resulting in millions of lines of log file: image

image

agrif commented 3 years ago

wohba, yeah that's not good. This should be easy, and it's sort of important, so I'll try to do this fast.

agrif commented 1 year ago

"Fast" I said.

I've changed the code to only output the full exception when it changes, and then added some exponential backoff to the reconnection. Now it'll try after 1 second, then 2, then so on, although it'll never wait longer than 10 minutes. This should shave a few orders of magnitude off those log sizes, at least.

This change is in version 1.4.0, which is now available.