Huge log files

New Contributor

Huge log files

Hello,

I have the following problem on my PC: BoxSync creates a lot of huge log files in the directory AppData/Local/Box Sync/Logs and the size of the files can reach several Gb. It completely fiil my hard drive after a short period. So I have to delete them manually.

Is this behaviour normal and to you plan to fix this ?

Best regards

Eric

5 REPLIES
Community Manager

Re: Huge log files

Hi @couescrime,

Welcome to the Box Community and thanks for your first post in the forum!

 

Sorry to hear about this issue with the Box Sync logs. This can be expected behavior if your Box Sync program is constantly active and syncing, but if you don't think that is the case I would recommend opening a ticket and having this checked out by an agent.

If so, you should contact Box Support to help you directly.

New Contributor

Re: Huge log files

Hi 

so I maybe misunderstood the way how box works. Indeed, the program runs constantly on my computer since I want to keep my folders synced on my different computers. It doesn't seems to act like this on a MacBook. I still wonder why it creates such huge log file and how to avoid them. At least a way to clean them periodically should be nice. 

Frequent Contributor

Re: Huge log files

Also have multi-GB log files on MacBook.  Some are older than 1 month.  Need a way to cap the size of the log files, otherwise have to write a cron job to clear out the logs.  SSD drive space on Macs is precious....

New Contributor

Re: Huge log files

The log file generated is full of DEBUG log messages but unfortunately there does not seem to be any way to disable logging or set logging to a less verbose level such as WARN or ERROR?

 

As a workaround to this I have written a batch script to purge this file at windows start via the Windows Scheduler tool.

(purgelog.bat)

@Echo on
type nul > "<user dir>\AppData\Local\Box Sync\Logs\Box Sync-4.0.7848.log"
cd "C:\Program Files\Box\Box Sync\"
start "Box Sync" "BoxSync.exe"

New Contributor

Re: Huge log files

After further trials, I have found that using that using Windows scheduler tool to purge the log files and start Box Sync for some reason causes Box Sync to request your login every time it starts. A much easier simpler solution is to 

  1. Disable the existing Box Sync service by clicking the Windows key, then typing in "Services". Find the Box Sync service and change the startup type to manual.
  2. Create a new text file called purgelogs.bat containing the following code
    @echo on
    del "E:\Users\<username>\AppData\Local\Box Sync\Logs\*.log"
    cd "C:\Program Files\Box\Box Sync\"
    c:
    start "Box Sync" "BoxSync.exe"
  3. Save the bat file and create a shortcut to it
  4. Open the Run dialog by pressing the Windows Key + R
  5. Enter "shell:startup" to open the Windows\Start Menu\Programs\Startup folder
  6. Copy the shortcut to the purgelogs.bat file into the Startup folder

Now when you start Windows all the Box Sync log files will be deleted just before Box Sync starts up.