Out of disk space while using Epicor

Hello to all,

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… :wink:

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 !

Have a great day!

Pierre

4 Likes

That’s awesome Pierre, you are a tracing legend!

1 Like

Dats a lot of logs.

2 Likes

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.

2 Likes

This one appeared to work.

Define the path to the log files

$logPath = “C:\Path\To\LogFiles”

Get the current date

$currentDate = Get-Date

Define the retention period (14 days)

$retentionPeriod = 14

Get all log files in the directory

$logFiles = Get-ChildItem -Path $logPath -Filter *.log

Loop through each log file

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.”