• 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

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

 
Greenhorn
Posts: 4
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
reply
    Bookmark Topic Watch Topic
  • New Topic