Announcement Announcement Module
Collapse
No announcement yet.
System.out disappearing from MultiActionController Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • System.out disappearing from MultiActionController

    Hi,

    I've been battling with a logging problem for some time and it's very bizarre. I've got a Spring WebMVC app (2.5.6) deployed in Tomcat 5.5.27. I've made no modifications to Tomcat - it's out of the box.

    So I started with a MultiActionController that did this:

    log.info("Hello");

    And discovered log4j wasn't printing out the log statement. I was getting the log4k instance through slf4j, so I switched back to commons logging and that didn't fix the problem. I then wrote a jsp that did nothing more than this:

    <%
    *org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Object.class);
    *log.info("moo via logger from jsp");
    %>

    And it works correctly - I can see the log statement appear in the logs. So I put a System.out.println() in the MultiActionController, and that didn't work either! However it works in the JSP. So the log framework is definitely working. I therefore wrote a HelloWorld servlet, defined it in web.xml, and did nothing more than write to the logger and System.out - it works.

    Therefore, I find myself in a situation where a System.out, servletContext.log and logger.info is ignored when the source is within a Spring MVC bean (i.e. an extension of MultiActionController).

    Any thoughts?

    Thanks,


    John

  • #2
    Wonderful. A third party API I'm using is playing with Standard Out. Panic over

    Comment

    Working...
    X