Search in sources :

Example 1 with ApplicationPid

use of org.springframework.boot.ApplicationPid in project spring-boot by spring-projects.

the class LoggingSystemProperties method apply.

public void apply(LogFile logFile) {
    RelaxedPropertyResolver propertyResolver = RelaxedPropertyResolver.ignoringUnresolvableNestedPlaceholders(this.environment, "logging.");
    setSystemProperty(propertyResolver, EXCEPTION_CONVERSION_WORD, "exception-conversion-word");
    setSystemProperty(propertyResolver, CONSOLE_LOG_PATTERN, "pattern.console");
    setSystemProperty(propertyResolver, FILE_LOG_PATTERN, "pattern.file");
    setSystemProperty(propertyResolver, LOG_LEVEL_PATTERN, "pattern.level");
    setSystemProperty(PID_KEY, new ApplicationPid().toString());
    if (logFile != null) {
        logFile.applyToSystemProperties();
    }
}
Also used : ApplicationPid(org.springframework.boot.ApplicationPid) RelaxedPropertyResolver(org.springframework.boot.bind.RelaxedPropertyResolver)

Example 2 with ApplicationPid

use of org.springframework.boot.ApplicationPid in project spring-boot by spring-projects.

the class ApplicationPidFileWriter method writePidFile.

private void writePidFile(SpringApplicationEvent event) throws IOException {
    File pidFile = this.file;
    String override = getProperty(event, FILE_PROPERTIES);
    if (override != null) {
        pidFile = new File(override);
    }
    new ApplicationPid().write(pidFile);
    pidFile.deleteOnExit();
}
Also used : ApplicationPid(org.springframework.boot.ApplicationPid) File(java.io.File)

Aggregations

ApplicationPid (org.springframework.boot.ApplicationPid)2 File (java.io.File)1 RelaxedPropertyResolver (org.springframework.boot.bind.RelaxedPropertyResolver)1