• 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

Struts Log

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have downloaded the example-struts.WAR and deployed it in my local WSAD application Server and it is perfectly running .

I want to see the log for example there are so many logtrace and log.debug as follows .

if (log.isTraceEnabled()) {
log.trace(" Creating new RegistrationForm bean under key "
+ mapping.getAttribute());
}

Can any body help me how to see this log or where is the configuration setting for the log file so that aftre running the application I can see the log as well

Thanks in advance .
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts uses Apache commons logging, which is just a common API to get at many different underlying logging systems.

If you want to make the logging statements in the example work, just put log4j.jar in your WEB-INF/lib file, provide a log4j.properties file that defines appenders for the examples classes, and the logging statements will start outputting to those appenders. Apache Commons logging will sense the presence of log4j as your underlying logging system.
 
Monoj Roy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thanks for the reply but still I am not able to run the same.
Here is what I have done so far

Added the log4j.jar WEB-INF/lib
created log4j.properties with following containts

#Logger
log4j.rootLogger = debug , myAppender

#Appender
log4j.appender.myAppender = org.apache.log4j.ConsoleAppender
#log4j.appender.myAppender = org.apache.log4j.FileAppender
#log4j.appender.myAppender.file = Log4j.Log

#Layout
log4j.appender.myAppender.layout = org.apache.log4j.PatternLayout

Now what should next ... it is not working
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic