Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D2F7114A4 for ; Thu, 4 Sep 2014 04:40:14 +0000 (UTC) Received: (qmail 53446 invoked by uid 500); 4 Sep 2014 04:40:13 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 53402 invoked by uid 500); 4 Sep 2014 04:40:13 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 53391 invoked by uid 99); 4 Sep 2014 04:40:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2014 04:40:13 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ralph.goers@dslextreme.com designates 209.85.220.48 as permitted sender) Received: from [209.85.220.48] (HELO mail-pa0-f48.google.com) (209.85.220.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2014 04:40:08 +0000 Received: by mail-pa0-f48.google.com with SMTP id ey11so19017887pad.7 for ; Wed, 03 Sep 2014 21:39:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:mime-version:subject :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=mKcOqy+mtaI3pDuEdfOLcTy7BxBrleUJyiq30n6+PoY=; b=ZHRhlg648A8huOuxmd9t54/XrgYpS3zIkiyibvcfA6EIuBBouSMGn4r9d1EBjGcrQ9 /5SwYKnCblYDTo6l8uzhaYEGj9Hbc3CIU+AR8XacVkFSVu55czTm+iVWoELEhMFYzOQ2 BJOAiTxlzRkMwkJMpbv14h3VTt6uLbKEiyabE4guAv1345nr59/k3bNKRsY5S4FoPcwm CQ6opBZSB6wSnFDX54QoqwFNboS8ouR3vl+KOFPuciU2zgSE7y34b+KEQ4MlS03POoPE hQE+L/zHX9nvvJR/RlVFp6dNU2yv+3Svgoq2WSPQ+l3dMZtrRrIrRLvLb0IB1Jzt3gsR vF3w== X-Gm-Message-State: ALoCoQlwmBgQaCUILVv6jXLPmAkvcrsk0Z+iO5oMOXNPDdgLEyJZbrfy0Wjq5V/0iQxp4Ug02KqW X-Received: by 10.66.182.10 with SMTP id ea10mr3298801pac.123.1409805583859; Wed, 03 Sep 2014 21:39:43 -0700 (PDT) Received: from [192.168.2.100] (ip98-177-206-172.ph.ph.cox.net. [98.177.206.172]) by mx.google.com with ESMTPSA id v1sm407084pdp.76.2014.09.03.21.39.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 21:39:43 -0700 (PDT) From: Ralph Goers X-Google-Original-From: Ralph Goers Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: org.apache.loggin.log4j.core.pattern.DatePatternConverter blocking In-Reply-To: Date: Wed, 3 Sep 2014 21:39:39 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Log4J Users List X-Mailer: Apple Mail (2.1878.6) X-Virus-Checked: Checked by ClamAV on apache.org 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) ? >=20 > Regards, > -Yogesh >=20 > On Thursday, September 4, 2014, Matt Sicker wrote: >=20 >> Is it not possible to just use ThreadLocal? Is that not safe enough = or does >> it waste too many resources? >>=20 >>=20 >> On 3 September 2014 18:39, Mohit Anchlia > > wrote: >>=20 >>> Issue created >>>=20 >>> https://issues.apache.org/jira/browse/LOG4J2-812 >>>=20 >>>=20 >>> On Wed, Sep 3, 2014 at 4:28 PM, Ralph Goers = > > >>> wrote: >>>=20 >>>> 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 >>>>=20 >>>> What I would do is modify DatePatternConverter to >>>> a) use Java 8=92s java.time.format.DateTimeFormatter if running on = Java 8 >>>> b) use Joda Time=92s DateTimeFormat if it is present. >>>> c) create a pool of SimpleDateFormat objects and use those. >>>>=20 >>>> Please create a Jira issue for this. >>>>=20 >>>> Ralph >>>>=20 >>>> On Sep 3, 2014, at 3:00 PM, Mohit Anchlia > > >>> wrote: >>>>=20 >>>>> 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? >>>>=20 >>>>=20 >>>> = --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> >>>> For additional commands, e-mail: log4j-user-help@logging.apache.org >> >>>>=20 >>>>=20 >>>=20 >>=20 >>=20 >>=20 >> -- >> Matt Sicker > >>=20 --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org