@Test public void testLog4jAppender() throws IOException { configureSource(); PropertyConfigurator.configure(props); Logger logger = LogManager.getLogger(TestLog4jAppender.class); for(int count = 0; count <= 1000; count++){ int level = ((count % 5)+1)*10000; String msg = "This is log message number" + String.valueOf(count); logger.log(Level.toLevel(level), msg); Transaction transaction = ch.getTransaction(); transaction.begin(); Event event = ch.take(); Assert.assertNotNull(event); Assert.assertEquals(new String(event.getBody(), "UTF8"), msg); Map<String, String> hdrs = event.getHeaders(); Assert.assertNotNull(hdrs.get(Log4jAvroHeaders.TIMESTAMP.toString())); Assert.assertEquals(Level.toLevel(level), Level.toLevel(Integer.valueOf(hdrs.get(Log4jAvroHeaders.LOG_LEVEL .toString())) )); Assert.assertEquals(logger.getName(), hdrs.get(Log4jAvroHeaders.LOGGER_NAME.toString())); Assert.assertEquals("UTF8", hdrs.get(Log4jAvroHeaders.MESSAGE_ENCODING.toString())); transaction.commit(); transaction.close(); } }
public Log4jAppender(){ }
Log4jAppender extends AppenderSkeleton { public Log4jAppender(){ } }
Log4jAppender extends AppenderSkeleton { public Log4jAppender(){ } Log4jAppender();  Log4jAppender(String hostname, int port); }
Log4jAppender extends AppenderSkeleton { public Log4jAppender(){ } Log4jAppender();  Log4jAppender(String hostname, int port); @Override synchronized void append(LoggingEvent event); @Override synchronized void close(); @Override boolean requiresLayout(); void setHostname(String hostname); void setPort(int port); void setUnsafeMode(boolean unsafeMode); boolean getUnsafeMode(); void setTimeout(long timeout); long getTimeout(); void setAvroReflectionEnabled(boolean avroReflectionEnabled); void setAvroSchemaUrl(String avroSchemaUrl); @Override void activateOptions(); }
Log4jAppender extends AppenderSkeleton { public Log4jAppender(){ } Log4jAppender();  Log4jAppender(String hostname, int port); @Override synchronized void append(LoggingEvent event); @Override synchronized void close(); @Override boolean requiresLayout(); void setHostname(String hostname); void setPort(int port); void setUnsafeMode(boolean unsafeMode); boolean getUnsafeMode(); void setTimeout(long timeout); long getTimeout(); void setAvroReflectionEnabled(boolean avroReflectionEnabled); void setAvroSchemaUrl(String avroSchemaUrl); @Override void activateOptions();  }