bpozdena / OneDriveGUI

A simple GUI for OneDrive Linux client, with multi-account support.
GNU General Public License v3.0
704 stars 33 forks source link

Add log file size limit #118

Closed TechSupport26 closed 12 months ago

TechSupport26 commented 1 year ago

Recently oendrive-gui created a 7.5GB log file and I have not been able to open it yet. I want to make this suggestion to hopefully avoid this in the future.

Request. Limit file size to 1GB at most. When this limit is reached to create a new file so at least they can be opened with little issue. Eg. onedrive-gui.log and onedrive-gui-1.log so on and so forth.

When I figure out a way of opening the file I will see if I can share the content here.

TechSupport26 commented 1 year ago

The cause of this was when my computer ran out of disk space.

Here is an extract.

2023-09-04 07:54:43,498 [OneDriveGUI.py:2103][fn=read_stdout][INFO] - [email.address@here] Skipping item './user.onedrive.log' due to insufficient free space available on OneDrive
2023-09-04 07:54:43,498 [OneDriveGUI.py:2103][fn=read_stdout][INFO] - [email.address@here [M] Local file changed: ./user.onedrive.log

Let me know if you need any more information from the log file.

bpozdena commented 1 year ago

@TechSupport26 Time based log rotation is already implemented. Please lower the log rotation time period in the GUI settings. Let me know if that doesn't work for you and why.

TechSupport26 commented 1 year ago

Alright. I did not think of that. I will look at it tomorrow and get back to you.

TechSupport26 commented 1 year ago

I have set this to 1. I don't want to test it out but I believe that that will do the trick.

My only issue is that as I ran out of disk space the same 2 lines were written creating the huge file. You can close this as part of my question has been answered but I would suggest changing something so that when there is no disk space that it does not keep on writing over and over "insufficient free space available on OneDrive" Perhaps I can change that in the settings but I missed it. If so then my apologies.

Thanks.

TechSupport26 commented 12 months ago

Closing as issue resolved.

TechSupport26 commented 12 months ago

I am including this just in case someone else runs into the same issue.

I noticed a fair increase in CPU usage while OneDrive was running. I found that the same 2 lines were written over and over as mentioned earlier. This was fixed by deleting another log file (19GB) that I found elsewhere.

Something else that should be noted.

The following kept on repeating. I did not know why how to stop OneDrive from tracking the .log file as when it did this is it will eventually 'run out of disk space' (I just realised that it was trying to save the file to OneDrive) and produce the 2 lines mentioned above creating 2 large files if left running long enough. This was fixed by quitting OneDriveGUI, deleting both log files and doing a full resync.

See below an extract from the log file.

2023-Sep-13 21:13:13.846892 Processing user.onedrive.log 2023-Sep-13 21:13:13.8469931 The file last modified time has changed 2023-Sep-13 21:13:13.8473892 The file content has changed 2023-Sep-13 21:13:14.9262654 Uploading modified file user.onedrive.log ... done. 2023-Sep-13 21:13:14.9263647 Remaining free space on OneDrive: 2905549086 2023-Sep-13 21:13:15.5808233 [M] Local file changed: ./user.onedrive.log 2023-Sep-13 21:13:15.5810804 Processing user.onedrive.log 2023-Sep-13 21:13:15.5812358 The file last modified time has changed 2023-Sep-13 21:13:15.5818508 The file content has changed

I have also attached an extract from running OneDriveGUI in the cli. I hope it helps. onedrivegui run from cli extract.docx

bpozdena commented 12 months ago

@TechSupport26 why are you saving the log file into your sync dir? Save it elsewhere.

The default is "/tmp/onedrive-gui/onedrive-gui.log"

TechSupport26 commented 12 months ago

It was never saved in the sync directory. For some reason it was being copied there. This was fixed after I deleted both files and restarted OneDrive.

Edit: Looks like when I turned on logging in the OnedriveGUI settings it saved it to home/user/Onedrive/user.onedrive.log (As you mentioned) I have no idea why but I changed it to save where the other one is and have not had issues since.