You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2014/07/18 22:23:40 UTC

Log4j 2 and Commons Logging

Should we consider proposing that, at least conceptually, Commons Logging
be deprecated in favor of Log4j 2?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Log4j 2 and Commons Logging

Posted by Gary Gregory <ga...@gmail.com>.
On Fri, Jul 18, 2014 at 4:37 PM, Ralph Goers <ra...@dslextreme.com>
wrote:

> Commons Logging’s purpose is to provide a common API that can sit in front
> of any logging implementation. The Log4j API isn’t intended for that.  We
> have bridges that allow applications written using other APIs to use Log4j
> 2 as the implementation.  We do have a bridge from the Log4j 2 API to
> SLF4J, but that is the only one.  As such, I don’t see it as a replacement
> - at least not yet.
>

What about making v 2 a facade for other frameworks a theme for 2.1?

Gary


>
> Ralph
>
>
>
> On Jul 18, 2014, at 1:23 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Should we consider proposing that, at least conceptually, Commons Logging
> be deprecated in favor of Log4j 2?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Log4j 2 and Commons Logging

Posted by Matt Sicker <bo...@gmail.com>.
I would like to see Log4j 2 being used as a replacement for Commons
Logging, actually. During ApacheCon earlier this year, I spoke with a few
Tomcat developers, and it turns out that our LoggerContext design is
actually a lot more powerful than anything Commons Logging et al. can do.
Being able to support multiple logging configurations at the same time
without them affecting each other is a super useful feature for container
applications. Otherwise, these containers tend to have some sort of
extended loggers or a different framework entirely (e.g., JULI in Tomcat)
in order to support multiple configurations.

I'd like to see microbenchmarks, too, if there is any performance reason to
dissuade usage of Commons Logging. I hope that we can still get similar
performance when using the SLF4J API as the frontend to log4j-core, though,
as that will create immediate benefits for tons of programs and libraries.


On 18 July 2014 18:34, Remko Popma <re...@gmail.com> wrote:

> I thought the log4j-to-slf4j adapter was very forward thinking. It is a
> smart idea, and reminded me of Microsoft Excel's backward compatibility
> with Lotus-123 when they entered the market that was completely dominated
> by Lotus-123. (Lotus who? Exactly!)
>
> We could add some microbenchmarks to the perf module to see what penalty
> (if any) users would pay when logging to log4j2 via the various APIs:
> SLF4J, Commons Logging, Log4j-1.2 and the native Log4j2 API.
>
>
>
> On Sat, Jul 19, 2014 at 7:54 AM, Ralph Goers <ra...@dslextreme.com>
> wrote:
>
>> I thought about that, but it seemed more prudent to try to get people
>> using other frameworks to consolidate on using Log4j and not the other way
>> around.
>>
>> Ralph
>>
>> On Jul 18, 2014, at 1:40 PM, Matt Sicker <bo...@gmail.com> wrote:
>>
>> But what if I'm still using Java 1.2? :P
>>
>>
>> On 18 July 2014 15:37, Ralph Goers <ra...@dslextreme.com> wrote:
>>
>>> Commons Logging’s purpose is to provide a common API that can sit in
>>> front of any logging implementation. The Log4j API isn’t intended for that.
>>>  We have bridges that allow applications written using other APIs to use
>>> Log4j 2 as the implementation.  We do have a bridge from the Log4j 2 API to
>>> SLF4J, but that is the only one.  As such, I don’t see it as a replacement
>>> - at least not yet.
>>>
>>> Ralph
>>>
>>>
>>>
>>> On Jul 18, 2014, at 1:23 PM, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>> Should we consider proposing that, at least conceptually, Commons
>>> Logging be deprecated in favor of Log4j 2?
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>>
>>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>>
>>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Log4j 2 and Commons Logging

Posted by Remko Popma <re...@gmail.com>.
I thought the log4j-to-slf4j adapter was very forward thinking. It is a
smart idea, and reminded me of Microsoft Excel's backward compatibility
with Lotus-123 when they entered the market that was completely dominated
by Lotus-123. (Lotus who? Exactly!)

We could add some microbenchmarks to the perf module to see what penalty
(if any) users would pay when logging to log4j2 via the various APIs:
SLF4J, Commons Logging, Log4j-1.2 and the native Log4j2 API.



On Sat, Jul 19, 2014 at 7:54 AM, Ralph Goers <ra...@dslextreme.com>
wrote:

> I thought about that, but it seemed more prudent to try to get people
> using other frameworks to consolidate on using Log4j and not the other way
> around.
>
> Ralph
>
> On Jul 18, 2014, at 1:40 PM, Matt Sicker <bo...@gmail.com> wrote:
>
> But what if I'm still using Java 1.2? :P
>
>
> On 18 July 2014 15:37, Ralph Goers <ra...@dslextreme.com> wrote:
>
>> Commons Logging’s purpose is to provide a common API that can sit in
>> front of any logging implementation. The Log4j API isn’t intended for that.
>>  We have bridges that allow applications written using other APIs to use
>> Log4j 2 as the implementation.  We do have a bridge from the Log4j 2 API to
>> SLF4J, but that is the only one.  As such, I don’t see it as a replacement
>> - at least not yet.
>>
>> Ralph
>>
>>
>>
>> On Jul 18, 2014, at 1:23 PM, Gary Gregory <ga...@gmail.com> wrote:
>>
>> Should we consider proposing that, at least conceptually, Commons Logging
>> be deprecated in favor of Log4j 2?
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
>
>

Re: Log4j 2 and Commons Logging

Posted by Ralph Goers <ra...@dslextreme.com>.
I thought about that, but it seemed more prudent to try to get people using other frameworks to consolidate on using Log4j and not the other way around.

Ralph

On Jul 18, 2014, at 1:40 PM, Matt Sicker <bo...@gmail.com> wrote:

> But what if I'm still using Java 1.2? :P
> 
> 
> On 18 July 2014 15:37, Ralph Goers <ra...@dslextreme.com> wrote:
> Commons Logging’s purpose is to provide a common API that can sit in front of any logging implementation. The Log4j API isn’t intended for that.  We have bridges that allow applications written using other APIs to use Log4j 2 as the implementation.  We do have a bridge from the Log4j 2 API to SLF4J, but that is the only one.  As such, I don’t see it as a replacement - at least not yet.
> 
> Ralph
> 
> 
> 
> On Jul 18, 2014, at 1:23 PM, Gary Gregory <ga...@gmail.com> wrote:
> 
>> Should we consider proposing that, at least conceptually, Commons Logging be deprecated in favor of Log4j 2?
>> 
>> Gary
>> 
>> -- 
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
>> Java Persistence with Hibernate, Second Edition
>> JUnit in Action, Second Edition
>> Spring Batch in Action
>> Blog: http://garygregory.wordpress.com 
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
> 
> 
> 
> 
> -- 
> Matt Sicker <bo...@gmail.com>


Re: Log4j 2 and Commons Logging

Posted by Matt Sicker <bo...@gmail.com>.
But what if I'm still using Java 1.2? :P


On 18 July 2014 15:37, Ralph Goers <ra...@dslextreme.com> wrote:

> Commons Logging’s purpose is to provide a common API that can sit in front
> of any logging implementation. The Log4j API isn’t intended for that.  We
> have bridges that allow applications written using other APIs to use Log4j
> 2 as the implementation.  We do have a bridge from the Log4j 2 API to
> SLF4J, but that is the only one.  As such, I don’t see it as a replacement
> - at least not yet.
>
> Ralph
>
>
>
> On Jul 18, 2014, at 1:23 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Should we consider proposing that, at least conceptually, Commons Logging
> be deprecated in favor of Log4j 2?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Log4j 2 and Commons Logging

Posted by Ralph Goers <ra...@dslextreme.com>.
Commons Logging’s purpose is to provide a common API that can sit in front of any logging implementation. The Log4j API isn’t intended for that.  We have bridges that allow applications written using other APIs to use Log4j 2 as the implementation.  We do have a bridge from the Log4j 2 API to SLF4J, but that is the only one.  As such, I don’t see it as a replacement - at least not yet.

Ralph



On Jul 18, 2014, at 1:23 PM, Gary Gregory <ga...@gmail.com> wrote:

> Should we consider proposing that, at least conceptually, Commons Logging be deprecated in favor of Log4j 2?
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory