aspose file tools*
The moose likes Other Open Source Projects and the fly likes How to configure log4j.properties to log comments from mentioned packages only? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How to configure log4j.properties to log comments from mentioned packages only?" Watch "How to configure log4j.properties to log comments from mentioned packages only?" New topic
Author

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

Abhijit Roy Chowdhury
Greenhorn

Joined: Feb 25, 2009
Posts: 4

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.


Regards,
@bh!j!+
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1086
    
    1

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


 
Consider Paul's rocket mass heater.
 
subject: How to configure log4j.properties to log comments from mentioned packages only?