Limit the number of Log files generated by the Sage CRM’s Services

By | April 11, 2019

Sage CRM has inbuilt set of internal logging mechanisms which tracks all the activities performed in CRM as well as records the errors generated. These logs are mainly segregated into various types such as SQL logs, System logs, .Net logs etc. Apart from this, Sage CRM generate logs for the inbuilt services which are installed with the application those are CRM indexer service, Email manager etc.

New Stuff: Component Issue in Sage CRM 2018 R3

Since these services execute in every 5 mins, log files gets updated with the recent recording. Thinking from the System maintenance point of view, after a certain period of time these log files are of no use to system administrator. Thus, in order to avoid unnecessary storage utilization, maintenance team will have to manually keep on removing unwanted files.

In order to ease their work, below steps can be followed that will help to remove old log files by scheduling a Task.

1) Go to Control Panel | Administrative Tools | Task Scheduler. From the right panel click on “Create task”. Enter Name of task e.g. Delete Logging Files.

2) Now Click on Triggers tab. Click on New button to configure this job for Daily, Weekly or Monthly basis also set the time as for when you want this job to execute and click on OK button.

3) Now Click on Actions tab. Click on new button and add following script in Program/script. Then click on OK button.

“forfiles /P “C:\Program Files (x86)\Sage\CRM\Services\Logs” /D -2 /M *CRMSearchIndex.log /C “cmd /c del @file” ”

Whenever the Scheduler executes, two days old logs files will be auto-deleted.