@Test
    public void testCanLoggerBeSerialized() throws IOException, ClassNotFoundException {

        LoggerHolder lh1 = new LoggerHolder();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(baos);
        out.writeObject(lh1);
        out.close();

        lh1 = null;

        byte[] serializedLoggerHolder = baos.toByteArray();

        InputStream is = new ByteArrayInputStream(serializedLoggerHolder);
        ObjectInputStream in = new ObjectInputStream(is);
        LoggerHolder lh2 = (LoggerHolder) in.readObject();

        assertNotNull(lh2);
        assertNotNull(lh2.getLog());
        lh2.getLog().info("You must see this message as a log message");
    }
See http://jira.qos.ch/browse/SLF4J-252
@author Thorbjorn Ravn Andersen
slf4j-jdk14/src/test/java/org/slf4j/issue/LoggerSerializationTest.java