File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j on 2 jars on the same classloader

 
Sharon whipple
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks
We have 2 jars that are loaded on the same classloader,
I would like to properly initialize log4j (1.2.15) so it will write to different log location for each jar.

I renamed each log4j property file to the plugin name, but log is created with single line only
Once I use just one jar - The log is working ok,
What am I missing here?




Thank you!
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the classes in the two JAR files in different packages? Then you can just configure your loggers and appenders in the Log4J configuration file differently for the classes in the two different packages. No need to do complicated tricks.
 
Devarsh Shah
Greenhorn
Posts: 6
Eclipse IDE Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please explain why two jars are required??
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic