[
https://issues.apache.org/jira/browse/LOG4J2-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
cedric munger updated LOG4J2-2885:
----------------------------------
Description:
Logback fails to create appenders with a date pattern containing microseconds,
such as: dd/MM/yy HH:mm:ss.nnnnnn resulting as the following error message
during log4j initialization :
{code:java}
2020-07-03 16:56:40,691 main WARN Could not instantiate FastDateFormat with
pattern dd/MM/yy HH:mm:ss.nnnnnn java.lang.IllegalArgumentException: Illegal
pattern component: nnnnnn
at
org.apache.logging.log4j.core.util.datetime.FastDatePrinter.parsePattern(FastDatePrinter.java:311)
at
org.apache.logging.log4j.core.util.datetime.FastDatePrinter.init(FastDatePrinter.java:166)
at
org.apache.logging.log4j.core.util.datetime.FastDatePrinter.<init>(FastDatePrinter.java:159)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat.<init>(FastDateFormat.java:401)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat.<init>(FastDateFormat.java:386)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:108)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:105)
at
org.apache.logging.log4j.core.util.datetime.FormatCache.getInstance(FormatCache.java:86)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat.getInstance(FastDateFormat.java:151)
{code}
Only built in date pattern %d\{DEFAULT_MICROS} work to have microseconds
enabled in log statements.
was:
Logback fails to create appenders with a date pattern containing microseconds,
such as: dd/MM/yy HH:mm:ss.nnnnnn resulting as the following error message
during log4j initialization :
{code:java}
2020-07-03 16:56:40,691 main WARN Could not instantiate FastDateFormat with
pattern dd/MM/yy HH:mm:ss.nnnnnn java.lang.IllegalArgumentException: Illegal
pattern component: nnnnnn
at
org.apache.logging.log4j.core.util.datetime.FastDatePrinter.parsePattern(FastDatePrinter.java:311)
at
org.apache.logging.log4j.core.util.datetime.FastDatePrinter.init(FastDatePrinter.java:166)
at
org.apache.logging.log4j.core.util.datetime.FastDatePrinter.<init>(FastDatePrinter.java:159)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat.<init>(FastDateFormat.java:401)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat.<init>(FastDateFormat.java:386)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:108)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:105)
at
org.apache.logging.log4j.core.util.datetime.FormatCache.getInstance(FormatCache.java:86)
at
org.apache.logging.log4j.core.util.datetime.FastDateFormat.getInstance(FastDateFormat.java:151)
{code}
Only built in date pattern %d\{DEFAULT_MICROS} work to have microseconds
enables in log statements.
> Date patterns with microseconds do not work
> -------------------------------------------
>
> Key: LOG4J2-2885
> URL: https://issues.apache.org/jira/browse/LOG4J2-2885
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.13.3
> Reporter: cedric munger
> Priority: Minor
>
> Logback fails to create appenders with a date pattern containing
> microseconds, such as: dd/MM/yy HH:mm:ss.nnnnnn resulting as the following
> error message during log4j initialization :
>
> {code:java}
> 2020-07-03 16:56:40,691 main WARN Could not instantiate FastDateFormat with
> pattern dd/MM/yy HH:mm:ss.nnnnnn java.lang.IllegalArgumentException: Illegal
> pattern component: nnnnnn
> at
> org.apache.logging.log4j.core.util.datetime.FastDatePrinter.parsePattern(FastDatePrinter.java:311)
> at
> org.apache.logging.log4j.core.util.datetime.FastDatePrinter.init(FastDatePrinter.java:166)
> at
> org.apache.logging.log4j.core.util.datetime.FastDatePrinter.<init>(FastDatePrinter.java:159)
> at
> org.apache.logging.log4j.core.util.datetime.FastDateFormat.<init>(FastDateFormat.java:401)
> at
> org.apache.logging.log4j.core.util.datetime.FastDateFormat.<init>(FastDateFormat.java:386)
> at
> org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:108)
> at
> org.apache.logging.log4j.core.util.datetime.FastDateFormat$1.createInstance(FastDateFormat.java:105)
> at
> org.apache.logging.log4j.core.util.datetime.FormatCache.getInstance(FormatCache.java:86)
> at
> org.apache.logging.log4j.core.util.datetime.FastDateFormat.getInstance(FastDateFormat.java:151)
> {code}
> Only built in date pattern %d\{DEFAULT_MICROS} work to have microseconds
> enabled in log statements.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)