File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j propery configuration problem

 
Abhilash Chander
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • 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.



 
a kishore
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is your log4j file added in the classpath?
 
Kartik Tal
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic