← Back to plugin index

Log Cleanup Task

Description

Deletes the oldest log files periodically so that only a configurable number of log files are kept. This can be used to limit log file growth.

Log file timestamps are extracted from the log file names in order to determine which ones to delete.

Type name
LogCleanupTask
Class
com.airlock.iam.servicecontainer.app.application.configuration.task.LogCleanupTask
May be used by
Properties
Number Of Log Files To Keep (numberOfLogFilesToKeep)
Description

The number of log files to keep.

If there are more log files, the oldest ones will be deleted, such that only the configured number of log files remain.

Attributes
Integer
Mandatory
Log Directory (logDirectory)
Description
The directory in which the log files are stored.
Attributes
File/Path
Mandatory
Log File Name Patterns (logFileNamePatterns)
Description

Log file path pattern to determine which logs to clean up.

The oldest log files that match an expression will be deleted so that for every entry only the configured number of log files remain. Use $(timestamp) to mark the location of the log file timestamps.

Files that don't match any pattern will be completely ignored by this task.

Attributes
String-List
Optional
Default value
[loginapp.log.$(timestamp), adminapp.log.$(timestamp), servicecontainerapp.log.$(timestamp), medusa-audit.log.$(timestamp)]
Timestamp Format (timestampFormat)
Description

The format of the timestamp in the log file names.

Timestamps are marked by $(timestamp) and are use to determine the oldest log files, which are deleted first.

  • yyyy stands for the year.
  • MM stands for the month.
  • dd stands for the day.
Attributes
Enum
Optional
Default value
DEFAULT
YAML Template (with default values)

type: LogCleanupTask
id: LogCleanupTask-xxxxxx
displayName: 
comment: 
properties:
  logDirectory:
  logFileNamePatterns: [loginapp.log.$(timestamp), adminapp.log.$(timestamp), servicecontainerapp.log.$(timestamp), medusa-audit.log.$(timestamp)]
  numberOfLogFilesToKeep:
  timestampFormat: DEFAULT