logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yogesh Rao <yog...@gmail.com>
Subject Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking
Date Thu, 04 Sep 2014 04:11:05 GMT
How abt providing the date formatter as part of log4j itself ( on the lines
of FastDateFormatter from commons-lang) ?

Regards,
-Yogesh

On Thursday, September 4, 2014, Matt Sicker <boards@gmail.com> wrote:

> Is it not possible to just use ThreadLocal? Is that not safe enough or does
> it waste too many resources?
>
>
> On 3 September 2014 18:39, Mohit Anchlia <mohitanchlia@gmail.com
> <javascript:;>> wrote:
>
> > Issue created
> >
> > https://issues.apache.org/jira/browse/LOG4J2-812
> >
> >
> > On Wed, Sep 3, 2014 at 4:28 PM, Ralph Goers <ralph.goers@dslextreme.com
> <javascript:;>>
> > wrote:
> >
> > > The converter uses a SimpleDateFormat which is not thread safe and so
> is
> > > synchronized. I am sure there might be minor optimizations that could
> be
> > > done to this
> > >
> > > What I would do is modify DatePatternConverter to
> > > a) use Java 8’s java.time.format.DateTimeFormatter if running on Java 8
> > > b) use Joda Time’s DateTimeFormat if it is present.
> > > c) create a pool of SimpleDateFormat objects and use those.
> > >
> > > Please create a Jira issue for this.
> > >
> > > Ralph
> > >
> > > On Sep 3, 2014, at 3:00 PM, Mohit Anchlia <mohitanchlia@gmail.com
> <javascript:;>>
> > wrote:
> > >
> > > > I am using log4j2 and I am seeing almost all the threads
> > > > momentarily getting blocked on
> > > > org.apache.loggin.log4j.core.pattern.DatePatternConverter class. Is
> > this
> > > > expected?
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> <javascript:;>
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> <javascript:;>
> > >
> > >
> >
>
>
>
> --
> Matt Sicker <boards@gmail.com <javascript:;>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message