This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes INFO logging in Struts 1.3.10 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "INFO logging in Struts 1.3.10" Watch "INFO logging in Struts 1.3.10" New topic
Author

INFO logging in Struts 1.3.10

Steve Dambrosio
Greenhorn

Joined: Apr 02, 2009
Posts: 28
I'm upgrading to Struts 1.3.10 from 1.1 (yikes) and to tomcat 6.0 from tomcat 4.1. I got it working but I'm no longer getting some INFO log messages that I've found to be useful. For example:
INFO: Processing a 'POST' for path '/Welcome'

Does anyone know how to get these back (if possible)? BTW, I'm getting other INFO type messages just fine, for example "INFO: Tiles definition factory found for request processor '', so I don't think this has to do with the LEVEL of logging. Perhaps I need to tell Struts to be more verbose. Thanks!
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

tomcat6.x from 4.x really needs efforts for sure ! actually it is less compare to websphere6.x to websphere7.x what i believe!
Steve Dambrosio
Greenhorn

Joined: Apr 02, 2009
Posts: 28
Can anyone assist on my original post? Thanks.
Steve Dambrosio
Greenhorn

Joined: Apr 02, 2009
Posts: 28
The solution is to configure Struts logging to use Log4J as its logging implementation. This will allow you to configure the level of logging that you want. BTW, in struts 1.3 the message "Processing a 'POST' for path '/mypath'" is a DEBUG level message. The following might not be the very best practice, but I think it's a good start:

1. Download the Log4J jar file from http://jakarta.apache.org/log4j.

2. Copy the jar file to your application's WEB-INF/lib folder.

3. Create a log4j.properties file (note: I've read that creating a log4j.xml file instead is the new and improved method). In this example I write log messages in two different formats, one for my application messages and another for struts (and everything else). I decided to log DEBUG messages for the struts RequestProcessor.


4. Configure Commons Logging to use Log4J in the commons-logging.properties file as follows:


5. Place both files in your application's WEB-INF/classes folder (at this level, not in a subfolder). If you're using eclipse, but it right under the src folder and eclipse will automatically put it into WEB-INF/classes.

Hope this works!

 
Consider Paul's rocket mass heater.
 
subject: INFO logging in Struts 1.3.10
 
Similar Threads
Getting Configuration Files
servlet.log not working in struts/tomcat environment
Struts Action Question
SSLEXT behavior-- rewrite works, page doesn't come up
Can you help a STRUTS newbie?