Class FilenameFormatter


  • public class FilenameFormatter
    extends Object
    Creates, parses and scans for file names matching a specified pattern, such as logs/%mdc{tenant:-common}/%date{YYYY-'w'WW}/%application-%EE.log, which would expand to logs/example.org/2020-W01/myapplication-Mon.log if the MDC variable "tenant" was "example.org" and the date 2019/12/30 (which was the first week of the year 2020).

    The following conversion words are supported in the filename:

    • Constructor Detail

      • FilenameFormatter

        public FilenameFormatter​(String filenamePattern)
      • FilenameFormatter

        public FilenameFormatter​(String filenamePattern,
                                 Configuration configuration)
    • Method Detail

      • findFileNames

        public List<String> findFileNames()
      • generateName

        public String generateName​(org.logevents.observers.file.FileInfo fileInfo)
      • parse

        public org.logevents.observers.file.FileInfo parse​(String filename)