This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes How to disable struts debug/info messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to disable struts debug/info messages" Watch "How to disable struts debug/info messages" New topic
Author

How to disable struts debug/info messages

Mayer Salzer
Greenhorn

Joined: Apr 01, 2002
Posts: 20
Hi All,
I'm working with Struts for the first time and can't seem to disable the 'Info' messages. For example on every forward (to path ''default.do) I get a message on the console/log '[INFO] RequestProcessor - -Processing a 'POST' for path '/default''. I also get a bunch of other annoying info messages specially upon servlet initialization.
The strange thing is that no matter what I do the messages end up in my 'stderr' log/console (not 'stdout').
I'm using WSAD 5.0 (with 4.0 test environment) as well as the Websphere 4.05 server (the same thing happens in both WSAD and WAS).
I've tried using changing the values of the ActionServlet's 'debug' and 'detail' init-params but it did not help (I've used all of the following values to no avail -1, 0, 1, 2, 3 etc).
Here's an excerpt of my web.xml file.

Any help would be appreciated.
Thanks!
[ March 15, 2004: Message edited by: Mayer Salzer ]
[ March 15, 2004: Message edited by: Mayer Salzer ]

Sun Certified Programmer for Java 2 Platform
Dora Babu k
Greenhorn

Joined: Jul 09, 2003
Posts: 12
Might be you are using log4j check the log4j.properties debug level
Mayer Salzer
Greenhorn

Joined: Apr 01, 2002
Posts: 20
Dora,
I am using Log4J but I don't think that's it. The debug level is set to "ERROR" and I know it works because I dodn't get any of the other "debug" or "info" messages I have in my code. Also, my log4j messages go to a special log file, these (struts) messages are going to my "stderr" log/console.
Unless there's something else that I need to do with the log4j properties file - specifically for the struts servlet . . . ? Did you experience similar problems?
Thanks,
Mayer
Mayer Salzer
Greenhorn

Joined: Apr 01, 2002
Posts: 20
After some further research, I finally got it!
My Struts servlet was using the "commons" logging (org.apache.commons.logging). Once I figured that out it was merely a matter of time before I found this doc (http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/SimpleLog.html) on how to configure the "commons" logging interface.
For those interested, you can do it by setting System properties (i.e. System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "ERROR") or by creating a property file named "simplelog.properties" with that name/value pair, and putting the file in your (class loader) classpath.
I also came across this doc that explains how struts uses logging by default (http://jakarta.apache.org/struts/userGuide/building_controller.html#logging).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to disable struts debug/info messages