[
https://issues.apache.org/jira/browse/LOG4J2-768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mikhail Dobrinin updated LOG4J2-768:
------------------------------------
Description:
Creating a custom {{LogEventPatternConverter}} with an existing plugin name and
attempting to use it will *fail unpredictably* about 50% of the time on my
machine. At first it appeared to be a race condition, but after more inspection
the plugin name turned out to be the same as the existing thread name
converter. The plugin manager should probably throw some kind of exception when
it is registering a plugin whose name already is registered. I am attaching a
zip file which you can easily import as an Eclipse project to reproduce.
*Succesful Output*:
{code}
2014-08-06 15:10:08,539 ERROR [1] tests.TestLogger (TestLogger.java:27) -
running configuration: C:\dev\temp\log4j2-testing\log4j2.xml
2014-08-06 15:10:08,540 INFO [1] tests.TestLogger (TestLogger.java:29) - info
level
2014-08-06 15:10:08,541 ERROR [1] tests.TestLogger (TestLogger.java:30) - error
level
{code}
*Failure Output*:
{code}
2014-08-06 15:09:54,179 ERROR Unrecognized format specifier [T]
2014-08-06 15:09:54,179 ERROR Unrecognized conversion specifier [T] starting at
position 11 in conversion pattern.
2014-08-06 15:09:54,195 ERROR [%T] tests.TestLogger (TestLogger.java:27) -
running configuration: C:\dev\temp\log4j2-testing\log4j2.xml
2014-08-06 15:09:54,196 INFO [%T] tests.TestLogger (TestLogger.java:29) - info
level
2014-08-06 15:09:54,196 ERROR [%T] tests.TestLogger (TestLogger.java:30) -
error level
{code}
was:
Creating a custom {{LogEventPatternConverter}} with mapping key {{T}} and
attempting to use it will *fail unpredictably* about 50% of the time on my
machine. At first it appeared to be a race condition, but after more inspection
the plugin names were the same. The plugin manager should probably throw some
kind of exception when it is registering a plugin whose name already is
registered. I am attaching a zip file which you can easily import as an Eclipse
project to reproduce.
*Succesful Output*:
{code}
2014-08-06 15:10:08,539 ERROR [1] tests.TestLogger (TestLogger.java:27) -
running configuration: C:\dev\temp\log4j2-testing\log4j2.xml
2014-08-06 15:10:08,540 INFO [1] tests.TestLogger (TestLogger.java:29) - info
level
2014-08-06 15:10:08,541 ERROR [1] tests.TestLogger (TestLogger.java:30) - error
level
{code}
*Failure Output*:
{code}
2014-08-06 15:09:54,179 ERROR Unrecognized format specifier [T]
2014-08-06 15:09:54,179 ERROR Unrecognized conversion specifier [T] starting at
position 11 in conversion pattern.
2014-08-06 15:09:54,195 ERROR [%T] tests.TestLogger (TestLogger.java:27) -
running configuration: C:\dev\temp\log4j2-testing\log4j2.xml
2014-08-06 15:09:54,196 INFO [%T] tests.TestLogger (TestLogger.java:29) - info
level
2014-08-06 15:09:54,196 ERROR [%T] tests.TestLogger (TestLogger.java:30) -
error level
{code}
> Custom conversion specifier fails unpredictably when it should throw an error
> -----------------------------------------------------------------------------
>
> Key: LOG4J2-768
> URL: https://issues.apache.org/jira/browse/LOG4J2-768
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.0, 2.0.1
> Reporter: Mikhail Dobrinin
> Attachments: LOG4J2-768.zip
>
>
> Creating a custom {{LogEventPatternConverter}} with an existing plugin name
> and attempting to use it will *fail unpredictably* about 50% of the time on
> my machine. At first it appeared to be a race condition, but after more
> inspection the plugin name turned out to be the same as the existing thread
> name converter. The plugin manager should probably throw some kind of
> exception when it is registering a plugin whose name already is registered. I
> am attaching a zip file which you can easily import as an Eclipse project to
> reproduce.
> *Succesful Output*:
> {code}
> 2014-08-06 15:10:08,539 ERROR [1] tests.TestLogger (TestLogger.java:27) -
> running configuration: C:\dev\temp\log4j2-testing\log4j2.xml
> 2014-08-06 15:10:08,540 INFO [1] tests.TestLogger (TestLogger.java:29) -
> info level
> 2014-08-06 15:10:08,541 ERROR [1] tests.TestLogger (TestLogger.java:30) -
> error level
> {code}
> *Failure Output*:
> {code}
> 2014-08-06 15:09:54,179 ERROR Unrecognized format specifier [T]
> 2014-08-06 15:09:54,179 ERROR Unrecognized conversion specifier [T] starting
> at position 11 in conversion pattern.
> 2014-08-06 15:09:54,195 ERROR [%T] tests.TestLogger (TestLogger.java:27) -
> running configuration: C:\dev\temp\log4j2-testing\log4j2.xml
> 2014-08-06 15:09:54,196 INFO [%T] tests.TestLogger (TestLogger.java:29) -
> info level
> 2014-08-06 15:09:54,196 ERROR [%T] tests.TestLogger (TestLogger.java:30) -
> error level
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]