It looks like the log file
.config/joplin-desktop/log.txt never gets truncated/rotated by Joplin itself (this applies probably to the other log files as well).
Do I miss something or should/can I create a logrotate conf file snippet on my Linux system myself?
Nope, you’re not missing anything. There’s currently no rotation. But I like the idea.
As for the logrotate question, I’m not sure. I don’t know, if the logger process keeps the file pointer open, and what would happen, if one were to just remove the underlying file. Maybe @laurent can answer this.
I think the file doesn’t stay open between writes so it should be fine to rotate it. Eventually we should integrate this feature to the app too as it’s true the log keeps growing without limit at the moment.
OK, so I I’ll give it a try with the following logrotate file:
daily only for testing, weekly would be more appropriate
copytruncate should handle the case if the logger process keeps the file open
postrotate could be necessary if some process needs to be restarted
OK, it works (like expected).
I’ll use the following file as conf. file for logrotate:
This will rotate weekly (and compress) every log file found in
/home/user/.config/joplin-desktop/ and keep 4 old files.
Hint: one does not need to restart any service after putting this file into place (
/etc/logrotate.d) since logrotate is not a daemon but started via crontab/systemd timer.
Is there a way to do this in Windows? I know Linux has commands to truncate log files but I don't know about Windows.