@Test
public void ensureLogGoesOnSlf4j() {

    final Logger logger = WebBeansLoggerFacade.getLogger(Slf4jLoggerFactoryTest.class);
    assertTrue(logger.getClass().getName(), Slf4jLogger.class.isInstance(logger));
    final PrintStream original = System.err;
    final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    System.setErr(new PrintStream(new OutputStream() {
        @Override
        public void write(final int b) {
            buffer.write(b);
            original.write(b);
        }
        @Override
        public void write(final byte[] b) throws IOException {
            buffer.write(b);
            original.write(b);
        }
        @Override
        public void write(final byte[] b, final int off, final int len) {
            buffer.write(b, off, len);
            original.write(b, off, len);
        }
    }));
    try {
        logger.info("test log");
    } finally {
        System.setErr(original);
    }
    assertEquals(
            "[main] INFO " + getClass().getName() + " - test log\n",
            new String(buffer.toByteArray(), StandardCharsets.UTF_8));
}