• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

INFO logging in Struts 1.3.10

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone assist on my original post? Thanks.
 
Steve Dambrosio
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

 
Tell me how it all turns out. Here is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic