Revert to (mostly) previous version that still includes StatusConsoleListener

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/branches/LOG4J2-609@1610904 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
index 9660b23..595a0a4 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLogger.java
@@ -36,7 +36,7 @@
 /**
  *  This is the default logger that is used when no suitable logging implementation is available.
  */
-public class SimpleLogger extends AbstractLogger implements Closeable {
+public class SimpleLogger extends AbstractLogger {
 
     private static final long serialVersionUID = 1L;
 
@@ -179,9 +179,4 @@
     public void setStream(final PrintStream stream) {
         this.stream = stream;
     }
-
-    @Override
-    public void close() throws IOException {
-        this.stream.close();
-    }
 }
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
index c1abe23..7cdb693 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
@@ -57,6 +57,8 @@
     
     private static final int MAX_ENTRIES = PROPS.getIntegerProperty(MAX_STATUS_ENTRIES, 200);
 
+    private static final String DEFAULT_STATUS_LEVEL = PROPS.getStringProperty("log4j2.StatusLogger.level");
+
     private static final StatusLogger STATUS_LOGGER = new StatusLogger();
 
     private final SimpleLogger logger;
@@ -68,11 +70,8 @@
     private final Lock msgLock = new ReentrantLock();
 
     private StatusLogger() {
-    	final Level consoleLevel = Level.toLevel(PROPS.getStringProperty("log4j2.StatusLogger.console.level"), Level.ERROR);
-    	final PrintStream consoleDest ="out".equalsIgnoreCase(PROPS.getStringProperty("log4j2.StatusLogger.console.destination")) ? System.out : System.err; 
-    			
-		this.logger = new SimpleLogger("StatusLogger", consoleLevel, false,
-				true, false, false, Strings.EMPTY, null, PROPS, consoleDest);
+        this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, Strings.EMPTY, null, PROPS,
+                System.err);
     }
 
     /**
@@ -186,7 +185,6 @@
      */
     @Override
     public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable t) {
-        logger.logMessage(fqcn, level, marker, msg, t);
         StackTraceElement element = null;
         if (fqcn != null) {
             element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace());
@@ -198,10 +196,14 @@
         } finally {
             msgLock.unlock();
         }
-        for (final StatusListener listener : listeners) {
-            if (data.getLevel().isMoreSpecificThan(listener.getStatusLevel())) {
-                listener.log(data);
+        if (listeners.size() > 0) {
+            for (final StatusListener listener : listeners) {
+                if (data.getLevel().isMoreSpecificThan(listener.getStatusLevel())) {
+                    listener.log(data);
+                }
             }
+        } else {
+            logger.logMessage(fqcn, level, marker, msg, t);
         }
     }
 
@@ -251,8 +253,8 @@
 
     @Override
     public boolean isEnabled(final Level level, final Marker marker) {
-        if (logger.isEnabled(level)) {
-        	return true;
+        if (listeners.isEmpty()) {
+        	return logger.isEnabled(level);
         }
     	for (StatusListener listener : listeners) {
     		if (level.isLessSpecificThan(listener.getStatusLevel())) {