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

  • System.out disappearing from MultiActionController


    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:"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);
    *"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 is ignored when the source is within a Spring MVC bean (i.e. an extension of MultiActionController).

    Any thoughts?



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