KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > matuschek > jobo > LogFrameAppender


1 package net.matuschek.jobo;
2
3 /*********************************************
4     Copyright (c) 2001 by Daniel Matuschek
5 *********************************************/

6
7 import org.apache.log4j.AppenderSkeleton;
8 import org.apache.log4j.spi.LoggingEvent;
9
10 /**
11  *
12  * Simple object that is used to connect the JoBo LogFrame with
13  * Log4J. It simply implements a Log4J Appender
14  *
15  * @author Daniel Matuschek
16  * @version $Id $
17  */

18
19
20 public class LogFrameAppender extends AppenderSkeleton {
21   private LogFrame log;
22   
23   public LogFrameAppender(LogFrame log) {
24     super();
25     this.log=log;
26   }
27
28   public void append(LoggingEvent e) {
29     log.addMsg(e.getMessage().toString());
30   }
31
32   public void close() {
33     log.setVisible(false);
34   }
35
36   public boolean requiresLayout() {
37     return false;
38   }
39   
40 } // LogFrameAppender
41
Popular Tags