Class DateFileNameGenerator

  • All Implemented Interfaces:
    FileNameGenerator

    public class DateFileNameGenerator
    extends java.lang.Object
    implements FileNameGenerator
    Generate file name according to the timestamp, different dates will lead to different file names.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String generateFileName​(int logLevel, long timestamp)
      Generate a file name which represent a specific date.
      boolean isFileNameChangeable()
      Whether the generated file name will change or not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateFileNameGenerator

        public DateFileNameGenerator()
    • Method Detail

      • isFileNameChangeable

        public boolean isFileNameChangeable()
        Description copied from interface: FileNameGenerator
        Whether the generated file name will change or not.
        Specified by:
        isFileNameChangeable in interface FileNameGenerator
        Returns:
        true if the file name is changeable
      • generateFileName

        public java.lang.String generateFileName​(int logLevel,
                                                 long timestamp)
        Generate a file name which represent a specific date.
        Specified by:
        generateFileName in interface FileNameGenerator
        Parameters:
        logLevel - the level of the log
        timestamp - the timestamp when the logging happen
        Returns:
        the generated file name