Arun Rahul
Arun Rahul

Reputation: 605

Java Service Wrapper exception stack trace is split into multiple log events

We have one J2EE service deployed as service using JSW (Tanuki Software). Here is my logging configuration

wrapper.console.format=LPTM
wrapper.console.loglevel=INFO
wrapper.console.flush=TRUE

When ever we log exception stack traces, they are being split into multiple log events which is very annoying to debug. Log looks as follows

Simple log statement

log.error("error happened during authorization check", e)

e represents exception in above log

INFO   | jvm 2    | 2023/07/01 12:09:46 | Caused by: java.lang.reflect.InvocationTargetException: null
INFO   | jvm 2    | 2023/07/01 12:09:46 |   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 2    | 2023/07/01 12:09:46 |   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO   | jvm 2    | 2023/07/01 12:09:46 |   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO   | jvm 2    | 2023/07/01 12:09:46 |   at java.base/java.lang.reflect.Method.invoke(Method.java:566)

I tried with JUL, Log4j2, Logback and the issue remains. I think it is issue with wrapper itself.

Has anyone ever faced it? Is there a config or setting that can stop splitting the exception stack trace into multiple lines.

Thanks

Upvotes: 2

Views: 96

Answers (0)

Related Questions