airdcpp-web / airdcpp-webclient

Communal peer-to-peer file sharing application for file servers/NAS devices
https://airdcpp-web.github.io
171 stars 31 forks source link

airdcpp-webclient/config/Logs/ contained more than 1 year worth of files #467

Closed slrslr closed 2 months ago

slrslr commented 3 months ago

On Linux Debian, in /home/user/app/airdcpp-webclient/config/Logs/ contained more than 1 year worth of files. This is not practical, not necessary. I have tried to set its rotation inside a file: sudo nano /etc/logrotate.d/rsyslog It worked. My file is:

/var/log/syslog
/var/log/mail.info
# other paths here
/var/log/debug
/var/log/messages
/home/user/app/airdcpp-webclient/config/Logs/*.log
{
        rotate 0
        weekly
        missingok
        notifempty
        maxsize 5M
        maxage 30
#       compress
#       delaycompress
        sharedscripts
        postrotate
                /usr/lib/rsyslog/rsyslog-rotate
        endscript
}

One have to use absolute path, no $HOME variable inside the path.

Can you please by default preserve only limited amount if the logs? I think that the log level should be warnings and errors (if multiple levels can be defined). Also it may be sufficing to retain only like 1 month.

maksis commented 2 months ago

This isn't possible with logrotate? You can also use time variables in the log file/directory names and then clean up the old log files.

maksis commented 2 months ago

Writing an extension to handle this might also be possible. I don't really want to implement this in the application itself as there are many alternative ways to achieve this.