• 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

Log4j in struts

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm not sure if my question belongs here or in the open source forum. I'm having difficulty in using log4j logging with my struts project. I've put log4j-1.2.8.jar in my WEB-INF/lib folder. THis is my log4j.properties file:


Now in my UserRegistrationForm that extends ActionForm class i do this:


Then, i purposely submit the form with error in it but the log message doesn't get shown in the console like its supposed to. Could someone please help me out with this. I'm new at this and trying to learn. THanks for your time.

Regards,
Harpreet
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your rootLogger is set to WARN level and associated with stdout appender.
So, only WARN or more severe messages will go to stdout appender.
You're trying to see debug level.

Not sure how StrutsProject logger relates to your UserRegistrationForm class;
it is set to debug, but not associated to an appender.
Are you using commons logging?
(I don't use LogFactory.getLog() and quick google gave a bunch of commons references)


log4j.logger.StrutsProject=DEBUG
log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%5] %d{mm:ss}(%F:%M:%L)%n%m%n%n


[ February 23, 2005: Message edited by: Carol Enderlin ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic