### Question:
SyslogAppender extends SyslogAppenderBase<ILoggingEvent> { public void start() { super.start(); setupStackTraceLayout(); }  void start(); @Override SyslogOutputStream createOutputStream(); @Override int getSeverityForEvent(Object eventObject); Layout<ILoggingEvent> buildLayout(); boolean isThrowableExcluded(); void setThrowableExcluded(boolean throwableExcluded); String getStackTracePattern(); void setStackTracePattern(String stackTracePattern); static final public String DEFAULT_SUFFIX_PATTERN; static final public String DEFAULT_STACKTRACE_PATTERN; }### Answer:
@Test public void unlazyAppenderIsConnectedAtStart() throws InterruptedException { setMockServerAndConfigure(1, false); sa.setLazy(false); assertFalse(sa.isInitialized()); sa.start(); assertTrue(sa.isInitialized()); }
@Test public void lazyAppenderIsNotConnectedAtStart() throws InterruptedException { setMockServerAndConfigure(1, false); sa.setLazy(true); assertFalse(sa.isInitialized()); sa.start(); assertFalse(sa.isInitialized()); }
@Test public void lazyAppenderIsConnectedOnAppend() throws InterruptedException { setMockServerAndConfigure(1, false); sa.setLazy(true); assertFalse(sa.isInitialized()); sa.start(); assertFalse(sa.isInitialized()); logger.debug("hello world"); mockServer.join(8000); assertTrue(sa.isInitialized()); }
@Test public void lazyAppenderMessageIsDelivered() throws InterruptedException { setMockServerAndConfigure(1, false); sa.setLazy(true); sa.start(); Marker marker = MarkerFactory.getMarker("testMarker"); assertFalse(sa.isInitialized()); assertTrue(mockServer.getMessageList().isEmpty()); logger.debug(marker, "test msg"); assertTrue(sa.isInitialized()); mockServer.join(8000); assertTrue(mockServer.isFinished()); assertEquals(1, mockServer.getMessageList().size()); }
@Test public void unknownHostShouldNotCauseStopToFail() { sa.setSyslogHost("unknown.host"); sa.setFacility("MAIL"); sa.start(); sa.stop(); }