From log4j-dev-return-49591-apmail-logging-log4j-dev-archive=logging.apache.org@logging.apache.org Thu Feb 2 07:23:59 2017 Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65D8419643 for ; Thu, 2 Feb 2017 07:23:59 +0000 (UTC) Received: (qmail 39440 invoked by uid 500); 2 Feb 2017 07:23:59 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 39407 invoked by uid 500); 2 Feb 2017 07:23:59 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 39398 invoked by uid 99); 2 Feb 2017 07:23:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2017 07:23:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 9D3A5C0FA2 for ; Thu, 2 Feb 2017 07:23:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id lKhyCaniqFlx for ; Thu, 2 Feb 2017 07:23:58 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id BB7935FBBB for ; Thu, 2 Feb 2017 07:23:57 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 72F9DE041D for ; Thu, 2 Feb 2017 07:23:56 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 9853925290 for ; Thu, 2 Feb 2017 07:23:53 +0000 (UTC) Date: Thu, 2 Feb 2017 07:23:53 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-1805) FixedDateFormat improvements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-1805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15849569#comment-15849569 ] Remko Popma commented on LOG4J2-1805: ------------------------------------- They're not: this is about the FixedDateFormat, not about the commons-lang FastDateFormat. FixedDateFormat is our custom high performance and garbage free formatter for the fixed formats we have names for in the docs for the %d converter. The commons-lang stuff is called FastDateFormat and is used for any format that doesn't match the predefined fixed formats. The names can get a bit confusing, I agree. > FixedDateFormat improvements > ---------------------------- > > Key: LOG4J2-1805 > URL: https://issues.apache.org/jira/browse/LOG4J2-1805 > Project: Log4j 2 > Issue Type: Improvement > Components: Pattern Converters > Affects Versions: 2.6 > Reporter: Remko Popma > Assignee: Remko Popma > Fix For: 2.8.1 > > > *Proposed changes:* > * improve thread-safety of {{FixedDateFormat::updateMidnightMillis}} > * expose {{FixedDateFormat::millisSinceMidnight}} as a public method > In multi-threaded scenarios where time does not move forward monotonically, the implementation of {{FixedDateFormat::updateMidnightMillis}} can result in corrupted time stamps. In a project I am involved in we have a custom PatternConverter that uses FixedDateFormat to format the "event time". In these (artificial) tests, event time does not always move forward, so the {{updateMidnightMillis}} is called concurrently with varying values. This is not a production issue, but the implementation can be improved to be thread-safe without impacting performance by using double-checked locking. > Making {{FixedDateFormat::millisSinceMidnight}} public would provide a performant and convenient way to strip off the date component. Useful for systems that are on Java 7 or for systems on Java 8 that don't want to construct a {{LocalTime}} object every time this value is required. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org