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.
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.
Thanks Miwie, for Linux the logroate option is easy and nice I will try it.
I use Joplin also with Windows.
I found out that the Graph-Plugin writes many output in the logfiles, it seems every second.
You can just look for the homedir/.config/joplin-desktop/log.txt
how it grows ervery second!
I look into the logfile, that tells us: 2022-06-02 23:53:52: BackOffHandler: "Plugin joplin-plugin-knowledge-graph: Applying a backoff of 8 seconds due to frequent plugin API calls. Consider reducing the number of calls, caching the data, or requesting more data per call. API call was: ", "joplin.data.get", "[["tags","32e55312cc4546f1894b9e88e51d36b6","notes"],{"fields":["id"]}]", "[Wait count: 1]"
So in the Options:
UPDATE_INTERVAL
1000
Time interval (in ms) between updates requests to joplin. - DEFAULT: 1000
You may consider to increase the UPDATE INTERVAL to 30000 or more milliseconds, so a look into the logfile MAY HELP A LOT!
AND consider: Do you really need this plugin!!
I also appreciate, if there may be a log rotate of log file management for Windows!
I have to add my voice to the log rotate request. I was trying to figure out why everything is going so slowly and found the log file that is now 55MB and has been keeping track of events since I got this PC and installed Joplin about a year ago.
What bothers me more than the size of the log file is that all the notes that have been created and uploaded to our NextCloud are shown in the logs. Why?
Log rotation has been a feature of Joplin since v2.12.
Logs used to get a lot larger than 55MB. From my system it looks as if the log gets truncated at ≈100MB.
The release info states:
Rotating log
Up until now, the logs could grow to become very large, and if you wanted to shrink them down you would have to manually delete them. With this new release, we now automatically handle logs by rotating them - once the log becomes large enough it is moved to an archive. And once the archive is older than a number of days, it is deleted.
Thanks @dpoulton .
My question was why the contents of the notes was stored in the log?
The follow-on question would then be if the log is in cleartext and contains all the note info, why bother encrypting the notebook as anyone who gets access to the device can read all the notes in the log ... until it is rotated out and eventually deleted?
This is unrelated to the log file, but please keep in mind that encryption is used only when syncing notes. They are always stored in a plain form (in the Joplin's database) on your local device. There is no local encryption functionality in Joplin. If that is something that you need, then you should probably use full disk encryption or similar.
@dpoulton I have a question regarding the feature that I just read was introduced in version 2.12. Does this mean that every time the log.txt file reaches a certain size, Joplin automatically replaces it? I'm asking because some time ago, I created a script that's scheduled to run every two months to remove the file. If Joplin takes care of this now, I will remove the script, please confirm. Thanks
This appears to be what is happening on my system. I no longer have a large log file sitting in config-desktop. Just the current one and the archives less than 90 days old.