spring-boot: Custom logback configuration ignored in external Tomcat

When I provide custom logback.xml configuration the file is not being used when the war is deployed to external Tomcat (7.0.55). It is being used when running in embedded Tomcat though.

The content of logback.xml:

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

    <logger name="com.springframework" level="ERROR" />
</configuration>

The application output:

2014-08-25 09:05:29.565  WARN 5348 --- [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-25 09:05:29.643  INFO 5348 --- [on(3)-127.0.0.1] o.s.boot.SpringApplication               : ...

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Your suggestion makes sense to me - I was thrown by the fact that my configuration was picked up correctly (and an empty logfile created), but was then ignored from then on. Falling back to the original configuration would have the desired effect.

Part of the problem is the behind the scenes magic with regards to building the environment. Perhaps future properties could all be prefixed with ‘spring’ or similar to prevent these unintended namespace collisions?