Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Remko Popma
On a related note, the log4j-perf module has experimental source code and a benchmark for a custom formatter. This formatter can only handle the %d{ABSOLUTE} format (HH:mm:ss.SSS) which allows it to take some shortcuts and be 5-7x faster than SimpleDateFormat in single-threaded tests. However,

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Ralph Goers
That seems like a good idea. Ralph On Sep 3, 2014, at 9:11 PM, Yogesh Rao wrote: > 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 wrote: > >> Is it

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Ralph Goers
For this purpose I would think that would cause a bunch of problems. Ralph On Sep 3, 2014, at 6:59 PM, Matt Sicker 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 wrote: > >> I

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Yogesh Rao
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 wrote: > Is it not possible to just use ThreadLocal? Is that not safe enough or does > it waste too many resources?

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Matt Sicker
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 wrote: > Issue created > > https://issues.apache.org/jira/browse/LOG4J2-812 > > > On Wed, Sep 3, 2014 at 4:28 PM, Ralph Goers > wrote: > > > The con

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Mohit Anchlia
Issue created https://issues.apache.org/jira/browse/LOG4J2-812 On Wed, Sep 3, 2014 at 4:28 PM, Ralph Goers 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 woul

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Ralph Goers
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 T

Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Gary Gregory
Hi Mohit, What version and can you provide stack dumps? You can attach files to a new JIRA issue. Thank you! Gary On Wed, Sep 3, 2014 at 6:00 PM, Mohit Anchlia wrote: > I am using log4j2 and I am seeing almost all the threads > momentarily getting blocked on > org.apache.loggin.log4j.core.p

org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking

2014-09-03 Thread Mohit Anchlia
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?