LoggerImpl implements Logger { @Override public void ffdc(String methodName, FFDCProbeId probeId, Throwable throwable, Object... data) { FFDC.capture(logger, methodName, probeId, throwable, data); } LoggerImpl(Class<?> clazz);  LoggerImpl(org.slf4j.Logger logger); @Override void setClientId(String clientId); @Override void info(String message); @Override void warning(String message); @Override void error(String message); @Override void error(String message, Throwable throwable); @Override void entry(String methodName); @Override void entry(String methodName, Object... objects); @Override void entry(Object source, String methodName); @Override void entry(Object source, String methodName, Object... objects); @Override void exit(String methodName); @Override void exit(String methodName, Object result); @Override void exit(Object source, String methodName); @Override void exit(Object source, String methodName, Object result); @Override void data(String methodName); @Override void data(String methodName, Object... objects); @Override void data(Object source, String methodName); @Override void data(Object source, String methodName, Object... objects); @Override void throwing(String methodName, Throwable throwable); @Override void throwing(Object source, String methodName, Throwable throwable); @Override void ffdc(String methodName, FFDCProbeId probeId, Throwable throwable, Object... data); @Override void ffdc(Object source, String methodName, FFDCProbeId probeId, Throwable throwable, Object... data);  }
@Test public void testFFDC() { final MockLogger logger = new MockLogger(this.getClass().getName()); final Logger testLogger = LoggerFactory.getLogger(logger); final String methodName = "testFFDCMethod"; final Exception exception = new Exception("TestExceptionForFFDC"); testLogger.ffdc(this, methodName, FFDCProbeId.PROBE_007, exception, "data1", "data2"); MockEvent event = logger.getEvent(); System.out.println(event.message); assertEquals("Unexpected type", "error", event.type); assertEquals("Unexpected marker", LogMarker.FFDC.getValue(), event.marker); assertTrue("Unexpected message", event.message.contains(FFDCProbeId.PROBE_007.toString())); assertTrue("Unexpected message", event.message.contains("testFFDCMethod")); assertTrue("Unexpected message", event.message.contains(this.getClass().getName())); assertTrue("Unexpected message", event.message.contains("java.lang.Exception: TestExceptionForFFDC")); assertTrue("Unexpected message", event.message.contains("data1")); assertTrue("Unexpected message", event.message.contains("data2")); event = logger.getEvent(); System.out.println(event.message); assertEquals("Unexpected type", "info", event.type); assertTrue("Unexpected message", event.message.startsWith("Javacore diagnostic information")); try { event = logger.getEvent(); fail("Unexpected event: "+event); } catch(NoSuchElementException e) { } }