fix(manager-api): ensures `RestExceptionMapper` actually prints stack trace
fix(common-logging): ensure log4j2 receives error properly
MODIFY
common/logging/log4j2/src/main/java/io/apiman/common/logging/log4j2/Log4j2LoggerImpl.java
common/logging/log4j2/src/main/java/io/apiman/common/logging/log4j2/Log4j2LoggerImpl.java
@@ -75,7 +75,7 @@ public class Log4j2LoggerImpl implements IApimanLogger {
@Override
public void error(Throwable error) {
- logger.error(error);
+ logger.error(error.getMessage(), error);
}
@Override

MODIFY
manager/api/exceptions/src/main/java/io/apiman/manager/api/rest/exceptions/mappers/RestExceptionMapper.java
manager/api/exceptions/src/main/java/io/apiman/manager/api/rest/exceptions/mappers/RestExceptionMapper.java
@@ -22,6 +22,7 @@ import io.apiman.common.logging.IApimanLogger;
import io.apiman.manager.api.beans.exceptions.ErrorBean;
import io.apiman.manager.api.rest.exceptions.AbstractRestException;
+import java.io.PrintWriter;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -77,6 +78,7 @@ public class RestExceptionMapper implements ExceptionMapper<AbstractRestExceptio
LOGGER.error(exception);
if (isStackTraceEnabled()) {
try (StringBuilderWriter writer = new StringBuilderWriter()) {
+ exception.printStackTrace(new PrintWriter(writer));
return writer.getBuilder().toString();
}
} else {

fix(manager-api): ensures `RestExceptionMapper` actually prints stack trace

fix(common-logging): ensure log4j2 receives error properly