Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
2.9.0, 2.9.1
-
None
-
Windows 10, Java 9
Description
When using the JUL log manager, setting the java.locale.providers property to "HOST" causes log4j2 to crash when you next log something.
import java.util.logging.Level; import java.util.logging.Logger; public class LocalePropertyTest { /** * @param args the command line arguments */ public static void main(String[] args) { System.setProperty("java.locale.providers", "HOST,JRE,SPI"); System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager"); Logger.getLogger(LocalePropertyTest.class.getName()).log(Level.WARNING, "this is a test"); } }
Used the following libraries:
log4j-jul-2.9.1.jar
log4j-core-2.9.1.jar
log4j-api-2.9.1.jar
The error is very long. Here are the first few lines:
ERROR StatusLogger Error creating converter for d
java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.logging.log4j.core.pattern.PatternParser.createConverter(PatternParser.java:582)
at org.apache.logging.log4j.core.pattern.PatternParser.finalizeConverter(PatternParser.java:638)
at org.apache.logging.log4j.core.pattern.PatternParser.parse(PatternParser.java:414)
at org.apache.logging.log4j.core.pattern.PatternParser.parse(PatternParser.java:177)
at org.apache.logging.log4j.core.layout.PatternLayout$SerializerBuilder.build(PatternLayout.java:376)
Attachments
Issue Links
- is duplicated by
-
LOG4J2-2435 Unrecognized conversion specifier [logger] from Junit5 with Java 10 and locale C
- Resolved