Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to configure log4j.properties to log comments from mentioned packages only?

 
Abhijit Roy Chowdhury
Greenhorn
Posts: 4
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a package structure like com.xyz. I want a log4j.properties configuration which will put all comments/logs from this package classes to my custom log file & not from other lib jar packages. For example, struts.jar is there in the class path. All logging comments of this package is also appearing in my custom application log file.
Below is the log4j.properties configuration,

Below is the sample output from myapp.log

can anybody give some suggestion on how to implement this? or please mention the links if the solution already been mentioned somewhere else.
 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although I have less knowledge of Log4J , below mentioned are some URLs which talks about this problem

http://today.java.net/today/2004/05/20/Struts.pdf(Page 14 of this pdf)

http://yamankumar.blogspot.com/2011/03/log4j-architecture-and-configuration.html (point number 9)

I hope these links may provide some hints to you to solve your problem.

In case you have already found the solution, please post it here.

~ abhay


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic