ppkarwasz commented on issue #3282:
URL: 
https://github.com/apache/logging-log4j2/issues/3282#issuecomment-2523413394

   @Tonys-L,
   
   I can reproduce the issue with a simple:
   
   ```java
   for (int i = 0; ; i++) {
       try {
           Class.forName(Main.class.getName() + i);
       } catch (ClassNotFoundException e) {
           // ignore
       }
   }
   ```
   
   This has apparently been reported as 
[JDK-8037342](https://bugs.openjdk.org/browse/JDK-8037342), but has been 
classified as `wontfix`.
   
   I am not sure there is anything we can do to workaround this JDK bug: if you 
want packaging information in your stack traces (the trailing 
`~[nashorn.jar:?]`), we need to access all the classes in the stack trace of 
the exception. Might I suggest you switch from the (implicit) [`%xEx` 
pattern](https://logging.apache.org/log4j/3.x/manual/pattern-layout.html#converter-exception-extended)
 to an explicit [`%ex` 
pattern](https://logging.apache.org/log4j/3.x/manual/pattern-layout.html#converter-exception)?
 E.g.:
   
   ```xml
   <PatternLayout pattern="%d [%t] %p %c{.} - %m%n%ex"/>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to