Jan Zyka
Jan Zyka

Reputation: 17898

Spring boot with custom logback configuration

I'm trying to provide some custom logging levels to the default logback configuration, but it seems my configuration file is being ignored. I though Boot may skip it for whatever reason but if I make the file not valid (remove / of self-closing tag for example) I got an exception about not being able to parse it - so it is being picked up.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <!-- Spring boot base -->
    <include resource="org/springframework/boot/logging/logback/base.xml" />

    <logger name="com.wedgetail" level="WARN" />
    <logger name="nv" level="WARN" />
    <logger name="StatsLogger" level="WARN" />

</configuration>

So for testing purposes (as my loggers are may be wrongly spelled or whatever) I included:

<logger name="org.springframework" level="ERROR" />

When the application comes up I still see spring logging on info level:

2014-08-22 14:28:34.756  WARN 5444 --- [on(3)-127.0.0.1] o.s.b.l.LoggingApplicationListener       : Logging environment value '-Djava.util.logging.config.file="C:\Documents and Settings\zykajan\.IntelliJIdea13\system\tomcat\Unnamed_cnc-parent_2\conf\logging.properties"' cannot be opened and will be ignored

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.1.5.RELEASE)

2014-08-22 14:28:34.881  INFO 5444 --- [on(3)-127.0.0.1] o.s.boot.SpringApplication               : Starting application on prgdwm395059 with PID 5444 (C:\workspace\command-and-control\webapp\target\cnc-webapp-UNVERSIONED-SNAPSHOT\WEB-INF\lib\spring-boot-1.1.5.RELEASE.jar started by zykajan in C:\Apps\Apache\jakarta\apache-tomcat-7.0.55\bin)
2014-08-22 14:28:34.928  INFO 5444 --- [on(3)-127.0.0.1] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5dd439: startup date [Fri Aug 22 14:28:34 CEST 2014]; root of context hierarchy

I wonder whether the first line should ring bells unfortunatelly it doesn't in my case :)

2014-08-22 14:28:34.756  WARN 5444 --- [on(3)-127.0.0.1] o.s.b.l.LoggingApplicationListener       : Logging environment value '-Djava.util.logging.config.file="C:\Documents and Settings\zykajan\.IntelliJIdea13\system\tomcat\Unnamed_cnc-parent_2\conf\logging.properties"' cannot be opened and will be ignored

As usual, any tips much appreciated.

Upvotes: 2

Views: 4308

Answers (1)

Newbie
Newbie

Reputation: 7249

Upgrade to Spring Boot 1.1.6. for a fix of this issue.

Upvotes: 2

Related Questions