Log4j2 Question migration.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Log4j2 Question migration.

EDMONDO SENA
 Hello,

 I'm going from log4j to log4j2. Now I had in log4j package import for log4j.helpers.AbsoluteTimeDateFormat, log4j.helpers.ISO8601DateFormat and log4j.helpers.OptionConverter.
In log4j2 in which packages can I find this management?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Log4j2 Question migration.

Ralph Goers
When performing a migration the first step should be to itemize all the customizations you made to Log4j 1.x and what their purpose was. Log4j 2 has more capabilities and a different architecture so there are likely to be completely different ways of solving the problem. Rather than asking how to replace individual classes it would be better for you to ask broader questions about the problems you are trying to solve and what the best way would be to solve them.

Date formatting in Log4j 2 is handled by the FastDateFormat class. Log4j 2 doesn’t have the equivalent of the OptionConverter. That class appears to be doing several different things that are spread across several Log4j 2 classes. For example, it has a method for variable substitution. Log4j uses its StrSubstitutor class for that. Properties handling is delegated to PropertiesUtil, Class loading is handled in LoaderUtil.  To create components in Log4j 1 you extended some interface and do a lot of work yourself. Log4j 2’s plugin system handles some of that for you.

Ralph

> On Feb 18, 2020, at 1:31 AM, EDMONDO SENA <[hidden email]> wrote:
>
> Hello,
>
> I'm going from log4j to log4j2. Now I had in log4j package import for log4j.helpers.AbsoluteTimeDateFormat, log4j.helpers.ISO8601DateFormat and log4j.helpers.OptionConverter.
> In log4j2 in which packages can I find this management?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Log4j2 Question migration.

EDMONDO SENA
Hi Ralph,

in log4j2 there are no the following packages:

AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT

ISO8601DateFormat
AbsoluteTimeDateFormat
DateTimeDateFormat

What is the equivalent ?
How is it possible to implement them in Log4j2?

Kind regards.

//Edmondo.



On 2020/02/18 15:48:08, Ralph Goers <[hidden email]> wrote:

> When performing a migration the first step should be to itemize all the customizations you made to Log4j 1.x and what their purpose was. Log4j 2 has more capabilities and a different architecture so there are likely to be completely different ways of solving the problem. Rather than asking how to replace individual classes it would be better for you to ask broader questions about the problems you are trying to solve and what the best way would be to solve them.
>
> Date formatting in Log4j 2 is handled by the FastDateFormat class. Log4j 2 doesn’t have the equivalent of the OptionConverter. That class appears to be doing several different things that are spread across several Log4j 2 classes. For example, it has a method for variable substitution. Log4j uses its StrSubstitutor class for that. Properties handling is delegated to PropertiesUtil, Class loading is handled in LoaderUtil.  To create components in Log4j 1 you extended some interface and do a lot of work yourself. Log4j 2’s plugin system handles some of that for you.
>
> Ralph
>
> > On Feb 18, 2020, at 1:31 AM, EDMONDO SENA <[hidden email]> wrote:
> >
> > Hello,
> >
> > I'm going from log4j to log4j2. Now I had in log4j package import for log4j.helpers.AbsoluteTimeDateFormat, log4j.helpers.ISO8601DateFormat and log4j.helpers.OptionConverter.
> > In log4j2 in which packages can I find this management?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Log4j2 Question migration.

EDMONDO SENA
In reply to this post by Ralph Goers
Hi Ralph,

Below are not available in log4j2 and what is the equivalent ?

AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT

ISO8601DateFormat
AbsoluteTimeDateFormat
DateTimeDateFormat

Can you help me with an example?

Kind regards.
//Edmondo.


On 2020/02/18 15:48:08, Ralph Goers <[hidden email]> wrote:

> When performing a migration the first step should be to itemize all the customizations you made to Log4j 1.x and what their purpose was. Log4j 2 has more capabilities and a different architecture so there are likely to be completely different ways of solving the problem. Rather than asking how to replace individual classes it would be better for you to ask broader questions about the problems you are trying to solve and what the best way would be to solve them.
>
> Date formatting in Log4j 2 is handled by the FastDateFormat class. Log4j 2 doesn’t have the equivalent of the OptionConverter. That class appears to be doing several different things that are spread across several Log4j 2 classes. For example, it has a method for variable substitution. Log4j uses its StrSubstitutor class for that. Properties handling is delegated to PropertiesUtil, Class loading is handled in LoaderUtil.  To create components in Log4j 1 you extended some interface and do a lot of work yourself. Log4j 2’s plugin system handles some of that for you.
>
> Ralph
>
> > On Feb 18, 2020, at 1:31 AM, EDMONDO SENA <[hidden email]> wrote:
> >
> > Hello,
> >
> > I'm going from log4j to log4j2. Now I had in log4j package import for log4j.helpers.AbsoluteTimeDateFormat, log4j.helpers.ISO8601DateFormat and log4j.helpers.OptionConverter.
> > In log4j2 in which packages can I find this management?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Log4j2 Question migration.

Matt Sicker
If you’re using those in your code as normal date time formatting logic,
I’d recommend looking at java.time in Java 8. If you’re configuring the
pattern layout or similar with the log event time stamp, then that’s all
documented here:
http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout (see
the d/date pattern options).

On Tue, Feb 18, 2020 at 10:05 EDMONDO SENA <[hidden email]> wrote:

> Hi Ralph,
>
> Below are not available in log4j2 and what is the equivalent ?
>
> AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT
> AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT
> AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT
>
> ISO8601DateFormat
> AbsoluteTimeDateFormat
> DateTimeDateFormat
>
> Can you help me with an example?
>
> Kind regards.
> //Edmondo.
>
>
> On 2020/02/18 15:48:08, Ralph Goers <[hidden email]> wrote:
> > When performing a migration the first step should be to itemize all the
> customizations you made to Log4j 1.x and what their purpose was. Log4j 2
> has more capabilities and a different architecture so there are likely to
> be completely different ways of solving the problem. Rather than asking how
> to replace individual classes it would be better for you to ask broader
> questions about the problems you are trying to solve and what the best way
> would be to solve them.
> >
> > Date formatting in Log4j 2 is handled by the FastDateFormat class. Log4j
> 2 doesn’t have the equivalent of the OptionConverter. That class appears to
> be doing several different things that are spread across several Log4j 2
> classes. For example, it has a method for variable substitution. Log4j uses
> its StrSubstitutor class for that. Properties handling is delegated to
> PropertiesUtil, Class loading is handled in LoaderUtil.  To create
> components in Log4j 1 you extended some interface and do a lot of work
> yourself. Log4j 2’s plugin system handles some of that for you.
> >
> > Ralph
> >
> > > On Feb 18, 2020, at 1:31 AM, EDMONDO SENA <[hidden email]> wrote:
> > >
> > > Hello,
> > >
> > > I'm going from log4j to log4j2. Now I had in log4j package import for
> log4j.helpers.AbsoluteTimeDateFormat, log4j.helpers.ISO8601DateFormat and
> log4j.helpers.OptionConverter.
> > > In log4j2 in which packages can I find this management?
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> --
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Log4j2 Question migration.

Ralph Goers
In reply to this post by EDMONDO SENA
This response indicates that you didn’t read my email.

Please re-read that.

Ralph

> On Feb 18, 2020, at 8:57 AM, EDMONDO SENA <[hidden email]> wrote:
>
> Hi Ralph,
>
> in log4j2 there are no the following packages:
>
> AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT
>
> ISO8601DateFormat
> AbsoluteTimeDateFormat
> DateTimeDateFormat
>
> What is the equivalent ?
> How is it possible to implement them in Log4j2?
>
> Kind regards.
>
> //Edmondo.
>
>
>
> On 2020/02/18 15:48:08, Ralph Goers <[hidden email]> wrote:
>> When performing a migration the first step should be to itemize all the customizations you made to Log4j 1.x and what their purpose was. Log4j 2 has more capabilities and a different architecture so there are likely to be completely different ways of solving the problem. Rather than asking how to replace individual classes it would be better for you to ask broader questions about the problems you are trying to solve and what the best way would be to solve them.
>>
>> Date formatting in Log4j 2 is handled by the FastDateFormat class. Log4j 2 doesn’t have the equivalent of the OptionConverter. That class appears to be doing several different things that are spread across several Log4j 2 classes. For example, it has a method for variable substitution. Log4j uses its StrSubstitutor class for that. Properties handling is delegated to PropertiesUtil, Class loading is handled in LoaderUtil.  To create components in Log4j 1 you extended some interface and do a lot of work yourself. Log4j 2’s plugin system handles some of that for you.
>>
>> Ralph
>>
>>> On Feb 18, 2020, at 1:31 AM, EDMONDO SENA <[hidden email]> wrote:
>>>
>>> Hello,
>>>
>>> I'm going from log4j to log4j2. Now I had in log4j package import for log4j.helpers.AbsoluteTimeDateFormat, log4j.helpers.ISO8601DateFormat and log4j.helpers.OptionConverter.
>>> In log4j2 in which packages can I find this management?
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]