logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: [Dev][log4j2]Use log4j 1.2 and log4j 2.2 together
Date Mon, 27 Apr 2015 12:04:48 GMT
Yes, log4j.properties are ignored. 

However, your log4j2 config can capture all events. The simplest way is to configure a root
logger at trace level, with a file appender. This file will then contain all log events, both
from your app as well as from the 3rd part libraries. 

If you want to split this up, you will need to configure this in the log4j2 config. 

Sent from my iPhone

> On 2015/04/27, at 20:32, Chathura Priyankara <priyankarahac@gmail.com> wrote:
> 
> Hi Remco,
> 
> Thank you very much for the response. That is really helpful.
> but still I have some problems.
> 
> 1. Does that means If I use log4j-1.2-api-2.2 bridge in my application is it ignore all
log4j.properties files ?
> If it is the case the log4j.properties files inside third party libraries will be ignored
and logs form those applications will not appear.
> 
> Thanks!
> Chathura.
> 
> 
>> On Mon, Apr 27, 2015 at 4:42 PM, Remko Popma <remko.popma@gmail.com> wrote:
>> Log4j2 includes an adapter so that calls to the log4j-1.2 API are forwarded to the
log4j2 implementation. 
>> 
>> To use this, put the log4j-1.2-api-2.2.jar in the classpath and remove the log4j-1.2.17.jar
from the classpath. 
>> 
>> Configuration for log4j-1.2 will be ignored. Only the log4j2 config will be used.

>> 
>> Sent from my iPhone
>> 
>>> On 2015/04/27, at 19:30, Chathura Priyankara <priyankarahac@gmail.com>
wrote:
>>> 
>>> Hi,
>>> 
>>> Currently I'm working on upgrading an application from log4j 1.2.17 to log4j
2.2. This application use some third party applications like Axis2 which use log4j 1.2.x.

>>> 
>>> So I need to use both log4j 1.2 and log4j 2.2 together to make this application
work. 
>>> Is this possible to do ?
>>> 
>>> Thanks,
>>> Regards,
>>> Chathura
>>> 
>>> -- 
>>> Chathura Priyankara,
>>> Faculty of Information Technology,
>>> University of Moratuwa.
>>> Blog  : www.codeoncloud.blogspot.com
> 
> 
> 
> -- 
> Chathura Priyankara,
> Faculty of Information Technology,
> University of Moratuwa.
> Blog  : www.codeoncloud.blogspot.com

Mime
View raw message