Package org.springframework.boot.logging
Class LogFile
- java.lang.Object
- org.springframework.boot.logging.LogFile
public class LogFile extends Object
A reference to a log output file. Log output files are specified usinglogging.file
orlogging.path
Environment
properties. If thelogging.file
property is not specified"spring.log"
will be written in thelogging.path
directory.- Since:
- 1.2.1
- See Also:
get(PropertyResolver)
Field Summary
Fields Modifier and Type Field Description static String
FILE_PROPERTY
The name of the Spring property that contains the name of the log file.static String
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 Description void
applyTo(Properties properties)
Apply log file details toLOG_PATH
andLOG_FILE
map entries.void
applyToSystemProperties()
Apply log file details toLOG_PATH
andLOG_FILE
system properties.static LogFile
get(org.springframework.core.env.PropertyResolver propertyResolver)
Get aLogFile
from the given SpringEnvironment
.String
toString()
Field Detail
FILE_PROPERTY
public static final String FILE_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.- See Also:
- Constant Field Values
PATH_PROPERTY
public static final String PATH_PROPERTY
The name of the Spring property that contains the directory where log files are written.- See Also:
- Constant Field Values
Method Detail
applyToSystemProperties
public void applyToSystemProperties()
Apply log file details toLOG_PATH
andLOG_FILE
system properties.
applyTo
public void applyTo(Properties properties)
Apply log file details toLOG_PATH
andLOG_FILE
map entries.- Parameters:
properties
- the properties to apply to
get
public static LogFile get(org.springframework.core.env.PropertyResolver propertyResolver)
Get aLogFile
from the given SpringEnvironment
.- Parameters:
propertyResolver
- thePropertyResolver
used to obtain the logging properties- Returns:
- a
LogFile
ornull
if the environment didn't contain any suitable properties