1 16 17 package org.apache.commons.logging.log4j; 18 19 20 import java.util.ArrayList ; 21 import java.util.Iterator ; 22 import java.util.List ; 23 import org.apache.log4j.AppenderSkeleton; 24 import org.apache.log4j.spi.LoggingEvent; 25 26 27 33 34 public class TestAppender extends AppenderSkeleton { 35 36 37 38 40 41 private List events = new ArrayList (); 43 44 45 47 48 public Iterator events() { 49 return (events.iterator()); 50 } 51 52 53 public void flush() { 54 events.clear(); 55 } 56 57 58 60 61 protected void append(LoggingEvent event) { 62 events.add(event); 63 } 64 65 66 public void close() { 67 } 68 69 70 public boolean requiresLayout() { 71 return (false); 72 } 73 74 75 } 76 | Popular Tags |