/**
Khalid
*/
package org.sikuli.slides.utils.logging;

import javax.swing.JTextArea;

import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.spi.LoggingEvent;


public class TextAreaAppender extends AppenderSkeleton {
	private JTextArea logArea;
	private PatternLayout patternLayout;
	

	
	@Override
	public void close() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean requiresLayout() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	protected void append(LoggingEvent loggingEvent) {
		 myTextArea.append(myPatternLayout.format(loggingEvent));
	}
	
}

@@ -4,16 +4,17 @@
 %0AKhalid%0A
+ 
 */%0Apacka
@@ -84,74 +84,37 @@
 ea;%0A
-%0A
 import 
-org.apache.log4j.AppenderSkeleton;%0Aimport org.apache.log4j
+ch.qos.logback.classic
 .Pat
@@ -136,29 +136,36 @@
 ort 
-org.apache.log4j
+ch.qos.logback.classic
 .spi.
+I
 Logg
@@ -174,16 +174,56 @@
 gEvent;%0A
+import ch.qos.logback.core.AppenderBase;
 %0A%0Apublic
@@ -266,16 +266,27 @@
 nder
-Skeleton
+Base%3CILoggingEvent%3E
  %7B%0A%09
@@ -303,19 +303,21 @@
 extArea 
-log
+jText
 Area;%0A%09p
@@ -356,188 +356,447 @@
 ut;%0A
-%09%0A%0A%09%0A%09@Override%0A%09public void close() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%7D%0A%0A%09@Override%0A%09public boolean requiresLayout() %7B%0A%09%09// TODO Auto-g
+%0A%09public JTextArea getjTextArea() %7B%0A%09%09return jTextArea;%0A%09%7D%0A%0A%09public void setjTextArea(JTextArea jTextArea) %7B%0A%09%09this.jTextArea = jTextArea;%0A%09%7D%0A%0A%09@Override%0A%09public void start() %7B%0A%09%09if (this.patternLayout == null) %7B%0A%09%09%09addError(%22No pattern layout set for the app
 en
+d
 er
-ated method stub%0A%09%09return false
+ named %5B%22 + name + %22%5D.%22);%0A%09%09%09return;%0A%09%09%7D%0A%09%09if (this.jTextArea == null) %7B%0A%09%09%09addError(%22No JTextArea set for the appender named %5B%22 + name + %22%5D.%22);%0A%09%09%09return;%0A%09%09%7D%0A%09%09super.start()
 ;%0A%09%7D
@@ -831,16 +831,17 @@
  append(
+I
 LoggingE
@@ -845,24 +845,17 @@
 ngEvent 
-loggingE
+e
 vent) %7B%0A
@@ -860,69 +860,263 @@
 %7B%0A%09%09
- myTextArea.append(myPatternLayout.format(loggingEvent))
+String msg = this.patternLayout.doLayout(event);%0A%09%09this.jTextArea.append(msg);%0A%09%7D%0A%0A%09public PatternLayout getPatternLayout() %7B%0A%09%09return patternLayout;%0A%09%7D%0A%0A%09public void setPatternLayout(PatternLayout patternLayout) %7B%0A%09%09this.patternLayout = patternLayout
 ;%0A%09%7D%0A
-%09
 %0A%7D%0A

fix logging framework appender