<div dir="ltr"><div><div><div><div>Hello !<br><br></div>I'd like to separate my stacktrace from other logs in 2 different files. I manage to do that with 2 appenders:<br><br>The first one with %nopex:<br><encoder><br>      <charset>UTF-8</charset><br>      <pattern>%nopex %d{dd/MM/yyyy-HH:mm:ss.SSS} [%thread][%X{TRANSACTION_ID}] %-5level %logger{36}:%L - %msg%n</pattern><br>   </encoder><br><br></div>The second with only %xException{full}<br><br></div>But now I want to add my MDC field TRANSACTION_ID when an exception arises (and only when an exception pop up). Just adding %X{TRANSACTION_ID} to my pattern doesn't work, I have a new line for every log line even when I don't have any exception.<br><br></div><div>Do you have any idea of how to do it ?<br><br></div><div>Thank you !<br></div></div>