@Test public void testAsyncAppend() { final Appender appender = ctx.getConfiguration().getAppender("AsyncPulsarAppender"); appender.append(createLogEvent()); final Message<byte[]> item; synchronized (history) { assertEquals(1, history.size()); item = history.get(0); } assertNotNull(item); assertFalse(item.hasKey()); assertEquals(LOG_MESSAGE, new String(item.getData(), StandardCharsets.UTF_8)); }
@Override public void append(final LogEvent event) { if (avoidRecursive && event.getLoggerName() != null && event.getLoggerName().startsWith("org.apache.pulsar")) { LOGGER.warn("Recursive logging from [{}] for appender [{}].", event.getLoggerName(), getName()); } else { try { tryAppend(event); } catch (final Exception e) { error("Unable to write to Pulsar in appender [" + getName() + "]", event, e); } } }
PulsarAppender extends AbstractAppender { @Override public void append(final LogEvent event) { if (avoidRecursive && event.getLoggerName() != null && event.getLoggerName().startsWith("org.apache.pulsar")) { LOGGER.warn("Recursive logging from [{}] for appender [{}].", event.getLoggerName(), getName()); } else { try { tryAppend(event); } catch (final Exception e) { error("Unable to write to Pulsar in appender [" + getName() + "]", event, e); } } } }
PulsarAppender extends AbstractAppender { @Override public void append(final LogEvent event) { if (avoidRecursive && event.getLoggerName() != null && event.getLoggerName().startsWith("org.apache.pulsar")) { LOGGER.warn("Recursive logging from [{}] for appender [{}].", event.getLoggerName(), getName()); } else { try { tryAppend(event); } catch (final Exception e) { error("Unable to write to Pulsar in appender [" + getName() + "]", event, e); } } } private  PulsarAppender(
            final String name,
            final Layout<? extends Serializable> layout,
            final Filter filter,
            final boolean ignoreExceptions,
            final boolean avoidRecursive,
            final PulsarManager manager); }
PulsarAppender extends AbstractAppender { @Override public void append(final LogEvent event) { if (avoidRecursive && event.getLoggerName() != null && event.getLoggerName().startsWith("org.apache.pulsar")) { LOGGER.warn("Recursive logging from [{}] for appender [{}].", event.getLoggerName(), getName()); } else { try { tryAppend(event); } catch (final Exception e) { error("Unable to write to Pulsar in appender [" + getName() + "]", event, e); } } } private  PulsarAppender(
            final String name,
            final Layout<? extends Serializable> layout,
            final Filter filter,
            final boolean ignoreExceptions,
            final boolean avoidRecursive,
            final PulsarManager manager); @PluginBuilderFactory static B newBuilder(); @Override void append(final LogEvent event); @Override void start(); @Override boolean stop(final long timeout, final TimeUnit timeUnit); @Override String toString(); }
PulsarAppender extends AbstractAppender { @Override public void append(final LogEvent event) { if (avoidRecursive && event.getLoggerName() != null && event.getLoggerName().startsWith("org.apache.pulsar")) { LOGGER.warn("Recursive logging from [{}] for appender [{}].", event.getLoggerName(), getName()); } else { try { tryAppend(event); } catch (final Exception e) { error("Unable to write to Pulsar in appender [" + getName() + "]", event, e); } } } private  PulsarAppender(
            final String name,
            final Layout<? extends Serializable> layout,
            final Filter filter,
            final boolean ignoreExceptions,
            final boolean avoidRecursive,
            final PulsarManager manager); @PluginBuilderFactory static B newBuilder(); @Override void append(final LogEvent event); @Override void start(); @Override boolean stop(final long timeout, final TimeUnit timeUnit); @Override String toString();  }