@@ -0,0 +1,1105 @@
+package ericminio.demo.logging;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.IOException;%0A%0Aimport static ericminio.support.ClearFile.clearFile;%0Aimport static ericminio.support.FileContent.contentOf;%0Aimport static org.hamcrest.CoreMatchers.containsString;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class ExceptionLoggingTest %7B%0A%0A    String filename = %22logs/42.log%22;%0A%0A    @Before%0A    public void cleanStart() %7B%0A        try %7B clearFile(filename); %7D%0A        catch (IOException e) %7B%7D%0A    %7D%0A%0A    @Test%0A    public void isAvailable() throws IOException %7B%0A        try %7B%0A            throw new RuntimeException(%22something bad happened%22);%0A        %7D%0A        catch (RuntimeException e) %7B%0A            Logger logger = LoggerFactory.getLogger(XmlConfigurationTest.class);%0A            logger.error(%22oops%22, e);%0A%0A            assertThat(contentOf(filename), containsString(%22%5BExceptionLoggingTest%5D - oops%22));%0A            assertThat(contentOf(filename), containsString(%22java.lang.RuntimeException: something bad happened%22));%0A        %7D%0A    %7D%0A%7D%0A

document Logging exceptions