This week I came accross an error during my use of Epicor. all my local c: drive was used, so forms could not open. Mind you I had a few already opened…
Looking at the hiarchy of files using a nice tool Wiztree, I found out where was my most usage. I found out that under my C:\Users\PierreH\AppData\Roaming\epicor\log there was a ton of files named TraceDataxxx.txt.
145 GB of them… since 2015, when we went live…
I did not realize to not forget to delete them after use when I am tracing a process… But I think there is a bit flag that I need to set to off and it is the first one (Enable trace logging) which was turned on…(thus the 145GB… )
So I thought it was a good idea to write this so users can be warned to disable this feature after use !
similar problem i found but on the server manager log files was filled with more than 200GB from process tasks, so i had to create a powerShell script to clear it on weekly bases leaving two weeks of data (ONLY) just in case we want to investigate any failed or error tasks.
foreach ($file in $logFiles) {
# Calculate the file’s age
$fileAge = $currentDate - $file.CreationTime
# Check if the file is older than the retention period
if ($fileAge.Days -gt $retentionPeriod) {
# Delete the file
Remove-Item -Path $file.FullName -Force
}
}
Output a message indicating the cleanup is complete
Write-Output “Log file cleanup complete. Files older than $retentionPeriod days have been deleted.”