I created an HttpCore ticket to get started:

https://issues.apache.org/jira/browse/HTTPCORE-436

I can do the port for Core and the other components if the community agrees
that it is a good thing.

Gary

On Fri, Sep 30, 2016 at 2:50 PM, Gary Gregory <garydgreg...@gmail.com>
wrote:

>
>
> On Fri, Sep 30, 2016 at 1:15 AM, Julian Sedding <jsedd...@apache.org>
> wrote:
>
>> Hi all
>>
>> I am not familiar with log4j2, but have used slf4j extensively over
>> the last years.
>>
>> As I understand log4j2 clearly separates its API from the
>> implementation. If this is true, are there any major benefits to using
>> the log4j2 API over the slf4j API?
>>
>> If this is not the case, and the benefits of log4j2 are predominantly
>> in the implementation, then it may be sensible to code against the
>> slf4j API and leave the choice of the implementation to the
>> deployment. I.e. it would be possible to use log4j2 as the logging
>> implementation via its slf4j binding[0].
>>
>
> From the Log4j 2 FAQ [https://logging.apache.org/log4j/2.x/faq.html#api-
> tradeoffs]:
>
> The Log4j 2 API and SLF4J have a lot in common. They both share the
> objective of cleanly separating the logging API from the implementation. We
> believe that the Log4j 2 API can help make your application more performant
> while offering more functionality and more flexibility.
>
> There may be a concern that using the Log4j 2 API will tightly couple your
> application to Log4j 2. This is not the case: applications coded to the
> Log4j 2 API always have the option to use any SLF4J-compliant library as
> their logging implementation with the log4j-to-slf4j adapter. See the which
> jars
> <https://logging.apache.org/log4j/2.x/faq.html#which_jars_log4j-to-slf4j> FAQ
> entry for details.
>
> There are several advantages to using the Log4j 2 API:
>
>    - SLF4J forces your application to log Strings. The Log4j 2 API
>    supports logging any CharSequence if you want to log text, but also
>    supports logging any Object as is. It is the responsibility of the logging
>    *implementation* to handle this object, and we consider it a design
>    mistake to limit applications to logging Strings.
>    - The Log4j 2 API offers support for logging Message objects
>    <https://logging.apache.org/log4j/2.x/manual/messages.html>. Messages
>    allow support for interesting and complex constructs to be passed through
>    the logging system and be efficiently manipulated. Users are free to create
>    their own Message types and write custom Layouts, Filters and Lookups to
>    manipulate them.
>    - The Log4j 2 API has support for Java 8 lambda expressions
>    <https://logging.apache.org/log4j/2.x/manual/api.html#LambdaSupport>.
>    - The Log4j 2 API has better support for garbage-free logging
>    <https://logging.apache.org/log4j/2.x/manual/garbagefree.html>: it
>    avoids creating vararg arrays and avoids creating Strings when logging
>    CharSequence objects.
>
> I'm not interested in porting the the HC code from ACL to Slf4j, but I'll
> do the port to Log4j2 ;-)
>
> Gary
>
>>
>> I am sure others, especially Gary, can provide more qualified opinions
>> here.
>>
>> Regards
>> Julian
>>
>> [0] https://logging.apache.org/log4j/2.0/log4j-slf4j-impl/index.html
>>
>>
>> On Thu, Sep 29, 2016 at 10:00 PM, Oleg Kalnichevski <ol...@apache.org>
>> wrote:
>> > On Thu, 2016-09-29 at 09:27 +0530, Asankha C. Perera wrote:
>> >> Hi Oleg
>> >
>> > ...
>> >
>> >> > Should be remain faithful to Commons Logging or shall we finally
>> migrate
>> >> > to SLF4J?
>> >> I agree with Gary that Log4J2 is better than SLF4J too. Since we also
>> >> have Gary's experience and support to move to it, I think that maybe
>> the
>> >> best option.
>> >>
>> >> regards
>> >> asankha
>> >>
>> >
>> > Gary, Asankha
>> >
>> > Being a happy user of Log4J2 myself I would be very much in favor of
>> > using it directly. However we ought not impose a particular choice of
>> > the logging toolkit upon all our users. We should be using a logging
>> > bridge. This essentially leaves with two options: Commons Logging or
>> > SLF4J, both of which can use different backends including Log4J2.
>> >
>> > Oleg
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
>> > For additional commands, e-mail: dev-h...@hc.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
>> For additional commands, e-mail: dev-h...@hc.apache.org
>>
>>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@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: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to