1 /** 2 * Logback: the generic, reliable, fast and flexible logging framework. 3 * 4 * Copyright (C) 2000-2009, QOS.ch 5 * 6 * This library is free software, you can redistribute it and/or modify it under 7 * the terms of the GNU Lesser General Public License as published by the Free 8 * Software Foundation. 9 */ 10 package chapter11; 11 12 import org.apache.log4j.AppenderSkeleton; 13 import org.apache.log4j.spi.LoggingEvent; 14 15 public class TrivialLog4jAppender extends AppenderSkeleton { 16 17 protected void append(LoggingEvent loggingevent) { 18 String s = this.layout.format(loggingevent); 19 System.out.println(s); 20 } 21 22 public void close() { 23 // nothing to do 24 } 25 26 public boolean requiresLayout() { 27 return true; 28 } 29 30 }