How to clean the folder of Slicer_Logs?

Operating system: Windows
Slicer version: 4.11.0-2019
Expected behavior: Keep Slicer_Logs folder as small as possible
Actual behavior: it is swelling after each usage

Hi All expertise in Slicer:
I happened to see my C: drive space shrunk and then figure it out that users\Documents\Slicer_Logs folder having lots of history of my slicer usage.

image

So how to keep it as small as possible? Is there any python/CLI functions so that I may clean it before or after each time usage?

Thanks a lot, Aiden

I’m not familiar with this “Slicer_Logs” directory within Documents. Did you go into Settings->Modules and change “Temporary Directory” from the default location of %LocalAppData%/Temp/Slicer ? This is where Slicer logs are typically found and are usually fairly small in size.

Did you change Settings->Cache which also has a default location of %LocalAppData%/Temp/Slicer/RemoteIO to be in “Slicer_Logs” and then increase the max cache size really large as well? Log files wouldn’t result in such a large file usage, but some cache location could grow large if you set the limit to something really high.

Or by chance have you been writing custom code or using a third party Slicer extension that is using this “Slicer_Logs” location?

Thanks a lot for your quick reply, James.

I guess I did not use a third party slicer extension associated with Slicer_Logs (or, LOL, I do not know it at all).

Yes, I did set up the “Temporary directory” as “C:/Users/Aiden.Zhu/documents/Slicer_Logs”. But it seems I did not really set up a large Cache, here is my settings:

image

So is there any command I may use to clean cache?
Thanks again.
Aiden

Only the last 10 log files are kept by default (you can change the value in your Slicer-NNN.ini file in LogFiles section “NumberOfFilesToKeep” value), but usually the files are small, so it should not be an issue.

Maybe you have enabled “Developer mode”. In developer mode, CLI module input and output files are not deleted after execution to make debugging easier. You can disable developer mode if this causes an issue for you.

@lassoan @jamesobutler
Thanks a lot.
Yeah, I guess it’s just due to my “Developer Mode” on. Then all right for me, I just need pay attention to it to make sure of that I have enough space in C-drive.

Best, Aiden

1 Like