How to use log4j 1.2 and 2.0 together?

  • Thread starter ±à³Ì¤ÎÀË×Ó
  • Start date
±

±à³Ì¤ÎÀË×Ó

There are two reference libraries in my project, one needs Log4j 1.2
and another one needs Log4j 2.0, how can they working together or
anyother solutions?

A customize class loader?

The reference libraries can not be changed.
 
D

Daniel Pitts

ç¼–ç¨‹ã®æµªå­ said:
There are two reference libraries in my project, one needs Log4j 1.2
and another one needs Log4j 2.0, how can they working together or
anyother solutions?

A customize class loader?

The reference libraries can not be changed.

What happens if you use log4j 2.0 with the first library? Does it fail?
What is the failure? What happens when you try the naive approach of
loading both packages? I would hope (but not necessarily expect) that
the namespaces between both are compatible.

Which reference libraries are they? Just because you say they can not be
changed doesn't convince me :)

Good luck,
Daniel
 
S

Simon

What happens if you use log4j 2.0 with the first library? Does it fail?
What is the failure?  What happens when you try the naive approach of
loading both packages? I would hope (but not necessarily expect) that
the namespaces between both are compatible.

Which reference libraries are they? Just because you say they can not be
changed doesn't convince me :)

Good luck,
Daniel

I do not get the failure right now, the first library is a framework
provided by my customer,
the second library is jBPM, the framework must uses Log4j 1.2 and jBPM
must uses Log4j 2.0.
I just want to know if 1.2 and 2.0 have the same namespace what can we
do?

Thanks a lot
 
A

Arne Vajhøj

Simon said:
I do not get the failure right now, the first library is a framework
provided by my customer,
the second library is jBPM, the framework must uses Log4j 1.2 and jBPM
must uses Log4j 2.0.
I just want to know if 1.2 and 2.0 have the same namespace what can we
do?

If there is a conflict in full class names, then you
will need to use classloaders - you do not need a custom
classloader - plain old URLClassLoader should do.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top