Zeronet: Logrotate

Created on 25 Oct 2018  路  7Comments  路  Source: HelloZeroNet/ZeroNet

Why?

The log files could eat up significant amount of disk space after some day of running

How?

Create new logfile every day, only keep last 10 one.

Plan

  • [x] Move current debug.log to debug-2018-05-25-10_25_15.log at startup and every 24 hour
  • [x] Only keep last 10 log files
enhancement

Most helpful comment

All 7 comments

Please, make it optional, by allowing the user to set the limit (1 day/2 days/10 days/1 month can be useful) and disable it at all.

please have optional + options

Usually logs rotate on filesize rather than time so that people know the exact max filesize the logs can be.

Then instead of multiple hours/day/month options you can just set the size in bytes.

I never seen a log rotate based on size (just checked my /etc/logrotate.d and all rotates daily/monthly) and I see no reason to disable it, but the number of the kept files will be configurable

I know systemd (journalctl) does, but after looking it up I think you're right, most things seem to go off time rotation.

You learn something new every day :D

The idea of deleting the oldest information is also useful in zeronet sites because not every one want to his or her sites become larger with time and the latest information often is the most careful for people.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mkg20001 picture mkg20001  路  3Comments

blurHY picture blurHY  路  3Comments

wigy-opensource-developer picture wigy-opensource-developer  路  4Comments

blurHY picture blurHY  路  3Comments

jerry-wolf picture jerry-wolf  路  4Comments