I was catching an exception and trying to write the stack trace to the logs like this:
log.warn(e.getMessage());
But all it said was
If you using Java 8 you can do the following:
LOGGER.error("Caught exception while methodX. Please investigate: " + exception + Arrays.asList(exception.getStackTrace()) .stream() .map(Objects::toString) .collect(Collectors.joining("\n")) );