Spring boot Spring Boot-logging.file属性没有任何效果?

Spring boot Spring Boot-logging.file属性没有任何效果?,spring-boot,Spring Boot,我已经使用boot1.0.0.RC1编写了一个应用程序 默认日志配置输出可以很好地满足我的需要,根据我的需要,我应该能够在application.properties中设置logging.file属性,以指定日志文件将存储在磁盘上的位置 但这似乎没有任何效果。我的日志以/tmp/spring.log结尾 logging.file属性在application.properties中定义: logging.file=/tmp/mylog.log mvn依赖项的输出:树: [INFO] +- org

我已经使用boot1.0.0.RC1编写了一个应用程序

默认日志配置输出可以很好地满足我的需要,根据我的需要,我应该能够在application.properties中设置logging.file属性,以指定日志文件将存储在磁盘上的位置

但这似乎没有任何效果。我的日志以/tmp/spring.log结尾

logging.file属性在application.properties中定义:

logging.file=/tmp/mylog.log
mvn依赖项的输出:树:

[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.0.0.RC1:compile
[INFO] |  \- org.springframework.boot:spring-boot-actuator:jar:1.0.0.RC1:compile
[INFO] |     \- org.hsqldb:hsqldb:jar:2.3.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.0.0.RC1:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:1.0.0.RC1:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.0.0.RC1:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-logging:jar:1.0.0.RC1:compile
[INFO] |     +- org.slf4j:jcl-over-slf4j:jar:1.7.5:compile
[INFO] |     +- org.slf4j:jul-to-slf4j:jar:1.7.5:compile
[INFO] |     +- org.slf4j:log4j-over-slf4j:jar:1.7.5:compile
[INFO] |     \- ch.qos.logback:logback-classic:jar:1.0.13:compile
[INFO] |        \- ch.qos.logback:logback-core:jar:1.0.13:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.0.0.RC1:compile
[INFO] |  +- org.springframework.security:spring-security-config:jar:3.2.0.RELEASE:compile
[INFO] |  |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  \- org.springframework.security:spring-security-core:jar:3.2.0.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-web:jar:3.2.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:4.0.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.0.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:4.0.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:4.0.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-expression:jar:4.0.0.RELEASE:compile
[INFO] |  \- org.springframework:spring-web:jar:4.0.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.0.0.RC1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.0.0.RC1:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.47:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:7.0.47:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.1:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.3.1:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:4.0.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.0.0.RC1:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:4.0.0.RELEASE:compile
[INFO] |  +- org.apache.tomcat:tomcat-jdbc:jar:7.0.47:compile
[INFO] |  |  \- org.apache.tomcat:tomcat-juli:jar:7.0.47:compile
[INFO] |  \- org.springframework:spring-tx:jar:4.0.0.RELEASE:compile
[INFO] +- org.thymeleaf:thymeleaf-spring4:jar:2.1.2.RELEASE:compile
[INFO] |  +- org.thymeleaf:thymeleaf:jar:2.1.2.RELEASE:compile
[INFO] |  |  +- ognl:ognl:jar:3.0.6:compile
[INFO] |  |  \- org.javassist:javassist:jar:3.16.1-GA:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.27:compile
[INFO] +- com.h2database:h2:jar:1.3.175:compile
[INFO] +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- org.hibernate:hibernate-validator:jar:5.0.1.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.1.GA:compile
[INFO] |  \- com.fasterxml:classmate:jar:0.8.0:compile
[INFO] +- org.yaml:snakeyaml:jar:1.13:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.0.0.RC1:test
[INFO] |  \- org.springframework:spring-test:jar:4.0.0.RELEASE:test
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
[INFO] |  \- org.objenesis:objenesis:jar:1.0:test
[INFO] \- org.hamcrest:hamcrest-library:jar:1.3:test
因此,logback位于类路径上,并从SpringBoot获取默认的base.xml配置

那么logging.file属性是不是应该开箱即用,或者我需要以不同的方式配置它

我知道我可以将logback.xml放在classpath中,以这种方式直接配置logback,并可能包括base.xml中的默认springboot logback配置,但如果我可以实现相同的功能,只需设置logging.file属性,我更愿意这样做

我使用的方法是在使用java-jar运行嵌入式Tomcat时指定-DLOG_FILE=logs/output.log


然而,我需要构建一个war并将其部署在一个独立的Tomcat中,我无权重新配置和设置环境属性,如LOG_FILE属性,因此我需要能够使用我的application.properties指定日志输出。

我更新了pom.xml,以使用Springboot的1.0.0.build-SNAPSHOT版本,现在它可以使用了在application.properties中指定logging.file可以很好地工作

这里有人能告诉我spring boot 1.0.0.RELEASE计划何时(大约)发布吗

干杯
弗莱明

我们一直以短期RC阶段为目标。这实际上主要取决于反馈(如果出现很多问题,则需要更长的时间)。RC2应该在下周,如果没有什么棘手的事情出现的话,希望还有一周或者更久,直到GA。谢谢你的更新。很高兴听到RC2就在附近。