You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2020/05/24 21:21:18 UTC

[log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Hi All,

Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x and
replace its usage with java.util.function.Supplier?

Gary

Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Ralph Goers <ra...@dslextreme.com>.
I do not want to alienate users in going from 2.x to 3.x.  From a user’s standpoint where all they have done is created their own Appender Plugins or are simply using Log4j they should not have to recode their application.

This is especially true with the API. Applications that simply use the API must be able to only change the dependency.  Applications that implement standard Plugins (Appenders, Layouts, Filters) should only have to recompile.  

User’s who customize more than that should expect to have to modify code. 

Ralph

> On May 24, 2020, at 3:17 PM, Gary Gregory <ga...@gmail.com> wrote:
> 
> On Sun, May 24, 2020 at 6:02 PM Ralph Goers <ra...@dslextreme.com>
> wrote:
> 
>> We can drop it where it won’t break backward compatibility.
>> 
> 
> It will break compatibility since APIs now typed to
> org.apache.logging.log4j.util.Supplier will be changed to
> java.util.function.Supplier. Call sites will have change imports from one
> package to another.
> 
> IMO, there should not be expectation of compatibility, since master is 3.0
> and a major version change.
> 
> Depending on how far we go for 3.0, we should repackage to a log4j3 package
> so that a complex stack could have Log4j 1, 2 and 3 live in the same class
> loader. Otherwise, we will be creating some jar hell.
> 
> A first step in any of this is to do this initial step
> (org.apache.logging.log4j.util.Supplier -> java.util.function.Supplier)
> plus Volkan's suggestion. Then we we can see how much breakage we cause but
> there is no excuse for shipping duplicate code
> (org.apache.logging.log4j.util.Supplier) for what is in Java 8
> (java.util.function.Supplier) for 3.0 IMO.
> 
> Gary
> 
> 
>> 
>> Ralph
>> 
>>> On May 24, 2020, at 2:57 PM, Volkan Yazıcı <vo...@gmail.com>
>> wrote:
>>> 
>>> May I second that with {Bi,Tri}Consumer classes as well?
>>> 
>>> On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com>
>> wrote:
>>>> 
>>>> Hi All,
>>>> 
>>>> Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x
>> and
>>>> replace its usage with java.util.function.Supplier?
>>>> 
>>>> Gary
>>> 
>> 
>> 
>> 



Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Gary Gregory <ga...@gmail.com>.
On Sun, May 24, 2020 at 6:02 PM Ralph Goers <ra...@dslextreme.com>
wrote:

> We can drop it where it won’t break backward compatibility.
>

It will break compatibility since APIs now typed to
org.apache.logging.log4j.util.Supplier will be changed to
java.util.function.Supplier. Call sites will have change imports from one
package to another.

IMO, there should not be expectation of compatibility, since master is 3.0
and a major version change.

Depending on how far we go for 3.0, we should repackage to a log4j3 package
so that a complex stack could have Log4j 1, 2 and 3 live in the same class
loader. Otherwise, we will be creating some jar hell.

A first step in any of this is to do this initial step
(org.apache.logging.log4j.util.Supplier -> java.util.function.Supplier)
plus Volkan's suggestion. Then we we can see how much breakage we cause but
there is no excuse for shipping duplicate code
(org.apache.logging.log4j.util.Supplier) for what is in Java 8
(java.util.function.Supplier) for 3.0 IMO.

Gary


>
> Ralph
>
> > On May 24, 2020, at 2:57 PM, Volkan Yazıcı <vo...@gmail.com>
> wrote:
> >
> > May I second that with {Bi,Tri}Consumer classes as well?
> >
> > On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com>
> wrote:
> >>
> >> Hi All,
> >>
> >> Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x
> and
> >> replace its usage with java.util.function.Supplier?
> >>
> >> Gary
> >
>
>
>

Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Ralph Goers <ra...@dslextreme.com>.
We can drop it where it won’t break backward compatibility.

Ralph

> On May 24, 2020, at 2:57 PM, Volkan Yazıcı <vo...@gmail.com> wrote:
> 
> May I second that with {Bi,Tri}Consumer classes as well?
> 
> On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com> wrote:
>> 
>> Hi All,
>> 
>> Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x and
>> replace its usage with java.util.function.Supplier?
>> 
>> Gary
> 



Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Remko Popma <re...@gmail.com>.
The intention of the core.time.Instant class is to provide a mutable equivalent of java.time.Instant (which is immutable).
 This allows for us to create high precision (sub-millisecond) timestamps while reusing some objects and remaining garbage free. 

So in short, no, our implementation provides functionality that the JDK class doesn’t have so we cannot replace it (at least not without loss of functionality).

> On Jun 3, 2020, at 18:59, Volkan Yazıcı <vo...@gmail.com> wrote:
> 
> Can we also replace core.time.Instant with java.time.Instant?
> 
>> On Sun, May 24, 2020 at 11:57 PM Volkan Yazıcı <vo...@gmail.com> wrote:
>> 
>> May I second that with {Bi,Tri}Consumer classes as well?
>> 
>>> On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com> wrote:
>>> 
>>> Hi All,
>>> 
>>> Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x and
>>> replace its usage with java.util.function.Supplier?
>>> 
>>> Gary

Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Matt Sicker <bo...@gmail.com>.
We looked at that before. It seems to introduce garbage, though I haven’t
investigated it in practice (it might optimize away through escape
analysis).

On Wed, Jun 3, 2020 at 07:24 Gary Gregory <ga...@gmail.com> wrote:

> I'm all for cleaning all that up a la Java 8.
>
> Gary
>
> On Wed, Jun 3, 2020, 05:59 Volkan Yazıcı <vo...@gmail.com> wrote:
>
> > Can we also replace core.time.Instant with java.time.Instant?
> >
> > On Sun, May 24, 2020 at 11:57 PM Volkan Yazıcı <vo...@gmail.com>
> > wrote:
> > >
> > > May I second that with {Bi,Tri}Consumer classes as well?
> > >
> > > On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com>
> > wrote:
> > > >
> > > > Hi All,
> > > >
> > > > Can we drop org.apache.logging.log4j.util.Supplier from master for
> 3.x
> > and
> > > > replace its usage with java.util.function.Supplier?
> > > >
> > > > Gary
> >
>
-- 
Matt Sicker <bo...@gmail.com>

Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Gary Gregory <ga...@gmail.com>.
I'm all for cleaning all that up a la Java 8.

Gary

On Wed, Jun 3, 2020, 05:59 Volkan Yazıcı <vo...@gmail.com> wrote:

> Can we also replace core.time.Instant with java.time.Instant?
>
> On Sun, May 24, 2020 at 11:57 PM Volkan Yazıcı <vo...@gmail.com>
> wrote:
> >
> > May I second that with {Bi,Tri}Consumer classes as well?
> >
> > On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com>
> wrote:
> > >
> > > Hi All,
> > >
> > > Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x
> and
> > > replace its usage with java.util.function.Supplier?
> > >
> > > Gary
>

Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Volkan Yazıcı <vo...@gmail.com>.
Can we also replace core.time.Instant with java.time.Instant?

On Sun, May 24, 2020 at 11:57 PM Volkan Yazıcı <vo...@gmail.com> wrote:
>
> May I second that with {Bi,Tri}Consumer classes as well?
>
> On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com> wrote:
> >
> > Hi All,
> >
> > Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x and
> > replace its usage with java.util.function.Supplier?
> >
> > Gary

Re: [log4j] Drop org.apache.logging.log4j.util.Supplier from master for 3.x

Posted by Volkan Yazıcı <vo...@gmail.com>.
May I second that with {Bi,Tri}Consumer classes as well?

On Sun, May 24, 2020 at 11:21 PM Gary Gregory <ga...@gmail.com> wrote:
>
> Hi All,
>
> Can we drop org.apache.logging.log4j.util.Supplier from master for 3.x and
> replace its usage with java.util.function.Supplier?
>
> Gary