Slf4j with Log4j does not print wrapped exception (caused by) when wrapper exception has a message
<p>First example:</p>

<pre><code>public class Main {

    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) throws Exception {
        try {
            throw new RuntimeException(new NullPointerException("NPE"));
        } catch (RuntimeException e) {
            logger.error("Error:", e);
        }
    }
}
</code></pre>

<p>Output:</p>

<pre><code>Error:
java.lang.RuntimeException: java.lang.NullPointerException: NPE
    at Main.main(Main.java:10)
</code></pre>

<p>In the second example we just add a message to the <code>RuntimeException</code> also:</p>

<pre><code>throw new RuntimeException("RTE", new NullPointerException("NPE"));
</code></pre>

<p>Output:</p>

<pre><code>Error:
java.lang.RuntimeException: RTE
    at Main.main(Main.java:10)
</code></pre>

<p>Why is <code>NullPointerException</code> not logged in this case?</p>

<p>Note: <code>e.printStackTrace()</code> prints both exceptions in both cases:</p>

<pre><code>java.lang.RuntimeException: RTE
    at Main.main(Main.java:10)
Caused by: java.lang.NullPointerException: NPE
    ... 1 more
</code></pre>

<p>Versions:</p>

<pre><code>slf4j-api: 1.7.12
slf4j-log4j12: 1.7.12
log4j: 1.2.17
</code></pre>