org.springframework.boot.logging

Class LogFile

  • java.lang.Object
    • org.springframework.boot.logging.LogFile


  • public class LogFile
    extends java.lang.Object
    A reference to a log output file. Log output files are specified using logging.file.name or logging.file.path Environment properties. If the logging.file.name property is not specified "spring.log" will be written in the logging.file.path directory.
    Since:
    1.2.1
    See Also:
    get(PropertyResolver)
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String FILE_NAME_PROPERTY
      The name of the Spring property that contains the name of the log file.
      static java.lang.String FILE_PATH_PROPERTY
      The name of the Spring property that contains the directory where log files are written.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void applyTo(java.util.Properties properties)
      Apply log file details to LOG_PATH and LOG_FILE map entries.
      void applyToSystemProperties()
      Apply log file details to LOG_PATH and LOG_FILE system properties.
      static LogFile get(org.springframework.core.env.PropertyResolver propertyResolver)
      Get a LogFile from the given Spring Environment.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • FILE_NAME_PROPERTY

        public static final java.lang.String FILE_NAME_PROPERTY
        The name of the Spring property that contains the name of the log file. Names can be an exact location or relative to the current directory.
        Since:
        2.2.0
        See Also:
        Constant Field Values
      • FILE_PATH_PROPERTY

        public static final java.lang.String FILE_PATH_PROPERTY
        The name of the Spring property that contains the directory where log files are written.
        Since:
        2.2.0
        See Also:
        Constant Field Values
    • Method Detail

      • applyToSystemProperties

        public void applyToSystemProperties()
        Apply log file details to LOG_PATH and LOG_FILE system properties.
      • applyTo

        public void applyTo(java.util.Properties properties)
        Apply log file details to LOG_PATH and LOG_FILE map entries.
        Parameters:
        properties - the properties to apply to
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • get

        public static LogFile get(org.springframework.core.env.PropertyResolver propertyResolver)
        Get a LogFile from the given Spring Environment.
        Parameters:
        propertyResolver - the PropertyResolver used to obtain the logging properties
        Returns:
        a LogFile or null if the environment didn't contain any suitable properties