Page 1 of 1

How do I limit the size of diskspace for log files of RevPiModIO?

Posted: 17 Nov 2024, 11:15
by Peter_Platzer
Dear All!

I am running into the issue of big Logfiles of RevPiModIO which fills up var/log/ on my RevPi.
It looks like it had something to do with changing the logfile.

End of last log:

Code: Select all

--2024-11-17 00:00:08--  https://apis.smartenergy.at/market/v1/price
Resolving apis.smartenergy.at (apis.smartenergy.at)... 193.186.222.188
Connecting to apis.smartenergy.at (apis.smartenergy.at)|193.186.222.188|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘/var/log/www/html/price_download.html’

     0K ....                                                    112M=0s

2024-11-17 00:00:08 (112 MB/s) - ‘/var/log/www/html/price_download.html’ saved [5054]

--2024-11-17 00:00:12--  https://api.awattar.at/v1/marketdata
Resolving api.awattar.at (api.awattar.at)... 35.244.230.217
Connecting to api.awattar.at (api.awattar.at)|35.244.230.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3515 (3.4K) [application/json]
Saving to: ‘/var/log/www/html/backup_price_download.html’

     0K ...                                                   100% 2.21M=0.002s

2024-11-17 00:00:12 (2.21 MB/s) - ‘/var/log/www/html/backup_price_download.html’ saved [3515/3515]

Start of new Log:

Code: Select all

-------------------------------------------------------
start new logfile: Sun Nov 17 00:00:33 2024
/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(
/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(
/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(
--2024-11-17 01:00:10--  https://apis.smartenergy.at/market/v1/price
Resolving apis.smartenergy.at (apis.smartenergy.at)... 193.186.222.188
Connecting to apis.smartenergy.at (apis.smartenergy.at)|193.186.222.188|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘/var/log/www/html/price_download.html’

     0K ....                                                    121M=0s

2024-11-17 01:00:11 (121 MB/s) - ‘/var/log/www/html/price_download.html’ saved [5054]

--2024-11-17 01:00:14--  https://api.awattar.at/v1/marketdata
Resolving api.awattar.at (api.awattar.at)... 35.244.230.217
Connecting to api.awattar.at (api.awattar.at)|35.244.230.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3371 (3.3K) [application/json]
Saving to: ‘/var/log/www/html/backup_price_download.html’

     0K ...                                                   100% 1.91M=0.002s

2024-11-17 01:00:14 (1.91 MB/s) - ‘/var/log/www/html/backup_price_download.html’ saved [3371/3371]

/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(
/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(
/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(
/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!
  warnings.warn(

The log message:

Code: Select all

/usr/lib/python3/dist-packages/revpimodio2/helper.py:627: RuntimeWarning: io refresh time of 20 ms exceeded!"
filled up the log file revpipyloadapp within 15 minutes to a size of 20 MB and I ran out of space on /var/log

Normally I do not see exceeding the 20 ms after downloading the files.
If it appears it happens maybe 1 or 2 times.

Is there a way to limit the size of log files?
What is the strategy of changing the log files?

Code: Select all

start new logfile: Sun Nov  3 00:00:33 2024
start new logfile: Sun Nov 10 00:00:33 2024
start new logfile: Sun Nov 17 00:00:33 2024
It looks like it is timebased every week.

Is it possible to change that?

Please give me some hints how to solve this issue.

Thanks!

BR
Peter

Re: How do I limit the size of diskspace for log files of RevPiModIO?

Posted: 12 Mar 2025, 13:10
by RevPiModIO
I suspect that a Bookworm image is being used where `logrotate` has not yet been installed.

Normally, log files, including those from RevPiPyLoad, are processed by `logrotate`. There have been versions of Bookworm images where the package was missing.

`logrotate` can be easily installed on the system using the command `apt-get install logrotate`.

Re: How do I limit the size of diskspace for log files of RevPiModIO?

Posted: 16 May 2025, 12:42
by Peter_Platzer
Logrotate is installed as I also use it for my phyton application.
I would like to configure the Logfile size for Logrotate of RevPiModIO.

Re: How do I limit the size of diskspace for log files of RevPiModIO?

Posted: 22 May 2025, 16:53
by tboehler
Hello,

yes, it is possible to customize the frequency of rotation and the size of logs. This is done in the file /etc/logrotate.conf and all files in /etc/logrotate.d/. Have a look at the manual page of logrotate(8) with "man 8 logrotate" where it is documented how to set this.

You probably want to have the logs rotate more often ("daily", for instance), at least for the specific log file that's causing you trouble.

Hope it helps!

--
Thomas