Log Cleanup Task
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.
numberOfLogFilesToKeep) 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.
logDirectory) logFileNamePatterns) 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.
timestampFormat) 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.
yyyystands for the year.MMstands for the month.ddstands for the day.
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