World Map
Java Service Wrapper is the easiest way to make your product more reliable.
  • Free Trial
  • Buy Now
wrapper.logfile.maxfiles Property

wrapper.logfile.maxfiles

Compatibility :2.2.5
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

The log file can be set to roll in a number of ways with token, depending on the roll mode. When rolling is enabled with token, this property will control the maximum number of rolled files which will be maintained.

This count does not include the current logging file, so a max files count of 3 will result in 3 historical files plus the current one, for a total of 4.

This property is ignored if wrapper.logfile.maxsize property is "0" (zero) or the wrapper.logfile.rollmode property is "NONE".

The default value is "0" (zero), which means no limit on the number of files preserved.

Example: (3 preserved files)
wrapper.logfile.maxfiles=3

Case: ROLLNUM token

When rolling with ROLLNUM token is used, this property defines the maximum number of log files rolled by ROLLNUM token.

If this property value is reduced from say "5" to "3", the extra 2 files will NOT be deleted automatically, and new log files will only be rolled within the first 3 files.

The file name including "ROLLNUM" will be sorted in ascending order so that the first top N files will be preserved.

Case: YYYYMMDD token

When rolling with YYYYMMDD token is used, this property defines the maximum number of past log files that will be maintained. Unlike the case with log files rolled by ROLLNUM token above, all files exceeded the specified limit will be DELETED automatically.

The file name including "YYYYMMDD" (DATE) will be sorted automatically in descending order so that the first top N (most recent) files will be preserved.

Pattern and Sort:

It's also possible that all files matching the pattern will be selected and sorted in the specific sort mode. All available files will be queried, and files that exceed the maximum number of log files will be deleted. For the details, see each property (wrapper.logfile.purge.pattern, wrapper.logfile.purge.sort)

The Pattern and Sort will be available only when the maximum number of log files has been set to a "non-zero" value.

Reference: logfile