2

I have a Spring app I'm compiling in Eclipse STS 3.7 and I'm running it on a Tomcat 8 server. Lately I have been getting a lot of DEBUG messages out to my console that I cannot seem to get rid of. They all look like this...

14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester -   New match='web-app'
14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester -   Fire begin() for org.apache.tomcat.util.descriptor.web.SetPublicIdRule@24f3d083
14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester - org.apache.tomcat.util.descriptor.web.WebXml.setPublicId(null)
14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester -   Fire begin() for org.apache.tomcat.util.descriptor.web.IgnoreAnnotationsRule@46f993c3
14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester - org.apache.tomcat.util.descriptor.web.WebXml.setMetadataComplete( false)
14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester -   Fire begin() for org.apache.tomcat.util.descriptor.web.VersionRule@3556c2ee
14:58:16.756 [localhost-startStop-1] DEBUG o.a.tomcat.util.digester.Digester - org.apache.tomcat.util.descriptor.web.WebXml.setVersion( 2.5)

There is of course a lot more of the above outputting. I can tell from the abbreviated address names (o.a.tomcat instead of org.apache.tomcat) that this is probably from the Spring Commons Logging. I can't for the life of me figure out how to turn it off. I have looked in various threads:

None of those solutions seemed to help. I know I must be overlooking something. My configuration is as follows...

src/main/resources/logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>

<configuration scan="true" scanPeriod="30 seconds">

    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
        <resetJUL>true</resetJUL>
    </contextListener>

    <!-- To enable JMX Management -->
    <jmxConfigurator/>

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>
                %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{0} - %msg%n
            </Pattern>
        </layout>
    </appender>


    <!--<logger name="org.hibernate" level="debug"/> -->
    <logger name="com.my.project" level="info"/>

    <root level="info">
        <appender-ref ref="console"/>
    </root>
</configuration>

Tomcat 8 VM Arguments (configured in Eclipse)

-Dcatalina.base="C:\Workspaces\windwaker\.metadata\.plugins\org.eclipse.wst.server.core\tmp0"
-Dcatalina.home="C:\apache-tomcat-8.0.28"
-Dwtp.deploy="C:\Workspaces\windwaker\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps"
-Djava.endorsed.dirs="C:\apache-tomcat-8.0.28\endorsed"
-Djava.util.logging.config.file="C:\apache-tomcat-8.0.28\conf\logging.properties"

C:\apache-tomcat-8.0.28\conf\logging.properties

.level=INFO
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter

If you want to know anything else about my setup I'm happy to share it. I appreciate any help you can offer.

Sunga
  • 309
  • 1
  • 4
  • 17

1 Answers1

0

I'm not able to reproduce your problem. I have Tomcat apache-tomcat-8.0.30, I used your logback.properties and also logging.properties, with a different I created mylogging.properties and used the path to those in -Djava.util.logging.config.file.

I have a simple MVC constroller (spring-webmvc, 4.2.4.RELEASE):

package test;

import java.util.Date;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ExecuteController {

//  @Autowired
    JdbcTemplate jdbcTemplate;

    @ResponseBody
    @RequestMapping(path="execute")
    public String execute() {
        return new Date().toString() + ": executed " + (jdbcTemplate == null);
    }

}

and even when called I do not see such messages in log.

Can you try with fresh installation and/or provide more info?

Betlista
  • 10,327
  • 13
  • 69
  • 110