Log file sizes: can I do circular?

Is there a way that I can configure the Epicor log files to operate in a circular way to save space? Meaning that they automatically overwrite or truncate entries older than X period of time rather than just growing in size endlessly? I have had to configure this for other systems, Exchange for example.

The issue that I am trying to address is that the size of the MultiCompanyDirect.log becomes enormous over time. This is what I am trying to “fix” at the moment but if there is a general method that applies to all Epicor logs, that would be good to know.

If there isn’t anything you ca do in Epicor, you could make a power shell script to copy the log to a filename with a date indicator logfile_20200429.log, then delete the original. Or try just renaming the existing file with that date based suffix. I didn’t suggest this first as i thought it might run into issue if the renaming tried to happen when the file was being written to.

1 Like

Thanks. I thought of that but was trying to avoid it, as I was hoping there is a more general setting for all Epicor logs. It sounds like no, probably not? Windows Event viewer is another example of where I’ve had to configure circular logging.

Here is a .BAT file that anyone else needing to manage their MultiCompanyDirect log can easily add to Task Scheduler: multicompany_log_circulate.txt (524 Bytes) [just rename the .TXT to .BAT]

If you schedule this to run once every X weeks, it will make a backup at the first X week period, then it will rename that backup at X+X weeks, then it will delete it at X+X+X weeks. In this way you’ll always have 2 backups of the log before they are deleted: one that is X weeks old and one that is X+X weeks old.

1 Like

Reason 97 having a modern logging system would be great…and one that would work in the cloud as well as on-prem.

This is a nice solution @aaronssh

2 Likes

BTW - @alintz provided a nice MRP Log PowerShell script that I use for MRP log management, it’s not Multicompany but if you wanted to upgrade the .BAT file to PowerShell, it might be helpful:

2 Likes

@aaronssh
good stuff mate i have to use yours to create something similar, i have tested it now, all advices are welcome :grin:

ControlLogFolderSize.txt (591 Bytes)