You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by EDMONDO SENA <ed...@gmail.com> on 2020/02/18 08:31:41 UTC

Log4j2 Question migration.

 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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 Question migration.

Posted by Ralph Goers <ra...@dslextreme.com>.
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 <ed...@gmail.com> 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 <ra...@dslextreme.com> 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 <ed...@gmail.com> 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: log4j-user-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> 
>>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 Question migration.

Posted by EDMONDO SENA <ed...@gmail.com>.
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 <ra...@dslextreme.com> 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 <ed...@gmail.com> 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: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 Question migration.

Posted by Matt Sicker <bo...@gmail.com>.
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 <ed...@gmail.com> 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 <ra...@dslextreme.com> 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 <ed...@gmail.com> 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: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
> --
Matt Sicker <bo...@gmail.com>

Re: Log4j2 Question migration.

Posted by EDMONDO SENA <ed...@gmail.com>.
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 <ra...@dslextreme.com> 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 <ed...@gmail.com> 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: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 Question migration.

Posted by Ralph Goers <ra...@dslextreme.com>.
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 <ed...@gmail.com> 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: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org