• 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 propery configuration problem

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am using Log4j for my applications logging. I need assitance for two of my problems.

1. I keep getting the following errors on the console


My log4j.properties file is located in the default source package and here is the code.


And is here is the code of my class using it

All my logging is working fine but I dont know why I am still getting these messages.


2. Secondly, this messages keeps printing on the console like 100 times in a single request

I tried to stop that logging by setting the level of my root logger to WARN and created my own logger 'com' for debug logging and set it at the top of the level heiarchy. But I am unable to stop it. Is there any other way to avoid this message from printing because its hard to find the log mesages I printed from my code.

Thanks in advance for your time.



 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mr. Chan,

I think you need to specify absolute path for you log4j.properties file. It should be something like this:

PropertyConfigurator.configure("C:\\WORKSPACE\\PROJECT\\web\\WEB-INF\\log4j.properties");

I hope this works

regards,
kishore
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is your log4j file added in the classpath?
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey.... For which version of Struts you are using?

The below info is for Struts 2
1) I had placed my log4j.properties file in src folder.
2) In web.xml include this code
 
reply
    Bookmark Topic Watch Topic
  • New Topic