Skip to content

Configure SEAL Logrotate


Default Behavior

On Windows, SEAL Logrotate deletes old log files of SEAL Systems. NSSM rotates the log files.

During the installation, the Seal Logfile Purging task is created in the Task Scheduler Library of the Windows Task Scheduler. By default, the task behaves as follows:

  • The task runs daily at 3:30 a.m.
  • The task runs under the local system account SYSTEM.
  • The task starts the C:\Program Files\SEAL Systems\seal-logrotate\PurgeLogfiles.bat batch script with the argument 7.
  • The batch script deletes all files in the C:\ProgramData\SEAL Systems\log\ log directory that were last modified 7 or more days ago.

Hint - affected files

Only files located directly in the log directory are deleted. Files in subdirectories are not affected. All files in the log directory are deleted regardless of their file extension.

If another log directory has been specified during the installation, this directory is used instead.

Hint - server not running

If the server is not running at the scheduled time, the run is skipped. It is not made up for later.


Task Definition

The task is defined in the C:\Program Files\SEAL Systems\seal-logrotate\PurgeLogfiles.xml file. The following elements control the behavior of the task:

  • StartBoundary: The time part specifies the time of day at which the task is started. Default: 03:30:00
  • DaysInterval: The task is started every <n> days. Default: 1
  • Arguments: Maximum age of the log files in days. Default: 7
<Triggers>
  <CalendarTrigger>
    <StartBoundary>2015-01-01T03:30:00</StartBoundary>
    <Enabled>true</Enabled>
    <ScheduleByDay>
      <DaysInterval>1</DaysInterval>
    </ScheduleByDay>
  </CalendarTrigger>
</Triggers>
<Actions Context="Author">
  <Exec>
    <Command>"C:\Program Files\SEAL Systems\seal-logrotate\PurgeLogfiles.bat"</Command>
    <Arguments>7</Arguments>
    <WorkingDirectory>C:\Program Files\SEAL Systems\seal-logrotate\</WorkingDirectory>
  </Exec>
</Actions>

The XML file is only used once during the installation to create the task. After that, the XML file and the task are independent of each other:

  • Changes to the XML file are not applied to the task automatically. They only become effective after you import the XML file again.
  • Changes in the Task Scheduler are not written back to the XML file.

We recommend making changes in the Task Scheduler. They are effective immediately.


Adjust the Configuration in the Task Scheduler

Adjust the task if the log files have to be kept longer or if the task has to run at another time.

Prerequisites:

  • You have administrator rights on the server.

Steps:

  1. Open the Windows Task Scheduler as administrator.

  2. Select Task Scheduler Library.

    Hint - hidden task

    The task is created as a hidden task. If Seal Logfile Purging is not displayed, activate View > Show Hidden Tasks.

  3. Double-click the Seal Logfile Purging task.

  4. To change the time or frequency, select the Triggers tab, select the trigger, and click Edit. Adjust the start time or the value of Recur every.

  5. To change the maximum age of the log files, select the Actions tab, select the Start a program action, and click Edit. In the Add arguments (optional) field, enter the number of days, for example 14.

  6. Confirm the changes with OK.

Validation:

  • In the Task Scheduler Library, the Next Run Time column of the Seal Logfile Purging task shows the new time.
  • To test the task, select it and click Run. After the run, the Last Run Result column shows The operation completed successfully. (0x0).

Adjust the Configuration via the XML File

As an alternative to the Task Scheduler, you can edit the XML file and import it again. This is useful if the same configuration has to be applied to several servers.

Prerequisites:

  • You have administrator rights on the server.

Steps:

  1. Edit C:\Program Files\SEAL Systems\seal-logrotate\PurgeLogfiles.xml as administrator.

    Caution - encoding

    The file is encoded in UTF-16. Save the file with the same encoding. Otherwise, the import fails.

  2. In a PowerShell as administrator, replace the existing task with the edited definition:

    schtasks /Create /TN "Seal Logfile Purging" /XML "C:\Program Files\SEAL Systems\seal-logrotate\PurgeLogfiles.xml" /F
    

Validation:

  • schtasks reports that the task has been created successfully.
  • In the Task Scheduler, the Seal Logfile Purging task shows the new values.

Caution - update

Custom changes are lost when SEAL Logrotate is updated. For more information, refer to Update SEAL Logrotate.



Back to top