You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/09/03 03:37:22 UTC

[01/29] git commit: [LOG4J2-810] Update javax.mail to 1.5.2 from 1.5.0.

Repository: logging-log4j2
Updated Branches:
  refs/heads/LOG4J2-608 48024c8e0 -> 228da65cd


[LOG4J2-810] Update javax.mail to 1.5.2 from 1.5.0.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6269f97c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6269f97c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6269f97c

Branch: refs/heads/LOG4J2-608
Commit: 6269f97cf0888b9b75605a436b074d844f0df7cc
Parents: 7be5f6e
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 08:27:18 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 08:27:18 2014 -0400

----------------------------------------------------------------------
 pom.xml                 | 2 +-
 src/changes/changes.xml | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6269f97c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e12f256..eeef103 100644
--- a/pom.xml
+++ b/pom.xml
@@ -479,7 +479,7 @@
       <dependency>
         <groupId>com.sun.mail</groupId>
         <artifactId>javax.mail</artifactId>
-        <version>1.5.0</version>
+        <version>1.5.2</version>
       </dependency>
       <dependency>
         <groupId>org.jboss.spec.javax.jms</groupId>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6269f97c/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 3dfa4b2..864d52a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -51,6 +51,9 @@
       <action issue="LOG4J2-801" dev="ggregory" type="update">
         org.apache.logging.log4j.core.Logger should be serializable.
       </action>      
+      <action issue="LOG4J2-810" dev="ggregory" type="update">
+        Update javax.mail to 1.5.2 from 1.5.0.
+      </action>      
     </release> 
     <release version="2.0.2" date="2014-08-16" description="Bug fixes and enhancements">
       <action issue="LOG4J2-775" dev="ggregory" type="update">


[26/29] git commit: Remove type casts to the ExtendedLogger interface from the public Logger interface. This means that the ExtendedLogger must be pushed up to all log4j-streams APIs. With this change, there are no casts to ExtendedLogger, just like in t

Posted by ma...@apache.org.
Remove type casts to the ExtendedLogger interface from the public Logger
interface. This means that the ExtendedLogger must be pushed up to all
log4j-streams APIs. With this change, there are no casts to
ExtendedLogger, just like in the rest of Log4j. The only cast needed,
unless we change LogManager is
"(ExtendedLogger)LogManager.getLogger(...)". See the example in the
class comment for LoggerPrintWriter.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c682ad5d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c682ad5d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c682ad5d

Branch: refs/heads/LOG4J2-608
Commit: c682ad5d5168b2e82e392dc15b9a6e24a51a7744
Parents: 41af200
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 20:30:29 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 20:30:29 2014 -0400

----------------------------------------------------------------------
 .../streams/LoggerBufferedInputStream.java      | 33 +++++++------
 .../log4j/streams/LoggerBufferedReader.java     | 17 ++++---
 .../log4j/streams/LoggerInputStream.java        | 17 ++++---
 .../log4j/streams/LoggerOutputStream.java       | 32 ++++++-------
 .../log4j/streams/LoggerPrintStream.java        | 49 ++++++++++----------
 .../log4j/streams/LoggerPrintWriter.java        | 27 ++++++-----
 .../logging/log4j/streams/LoggerReader.java     |  9 ++--
 .../logging/log4j/streams/LoggerStreams.java    | 26 +++++------
 .../logging/log4j/streams/LoggerWriter.java     |  9 ++--
 .../log4j/streams/LoggerWriterFilter.java       |  9 ++--
 .../log4j/streams/AbstractLoggerWriterTest.java |  2 +-
 .../log4j/streams/AbstractStreamTest.java       |  7 +++
 .../streams/LoggerBufferedInputStreamTest.java  |  2 +-
 .../log4j/streams/LoggerBufferedReaderTest.java |  2 +-
 .../log4j/streams/LoggerInputStreamTest.java    |  6 +--
 .../log4j/streams/LoggerOutputStreamTest.java   |  4 +-
 .../log4j/streams/LoggerPrintStreamTest.java    |  2 +-
 .../log4j/streams/LoggerPrintWriterTest.java    |  2 +-
 .../logging/log4j/streams/LoggerReaderTest.java |  2 +-
 .../log4j/streams/LoggerWriterFilterTest.java   |  2 +-
 .../logging/log4j/streams/LoggerWriterTest.java |  2 +-
 21 files changed, 130 insertions(+), 131 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
index 1ffeaac..90c7cea 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
@@ -23,7 +23,6 @@ import java.io.InputStream;
 import java.nio.charset.Charset;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
@@ -38,20 +37,20 @@ public class LoggerBufferedInputStream extends BufferedInputStream {
         super(new LoggerInputStream(in, charset, logger, fqcn, level, marker), size);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final Logger logger, final Level level) {
-        this(in, charset, size, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final ExtendedLogger logger, final Level level) {
+        this(in, charset, size, logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final Logger logger, final Level level, final Marker marker) {
-        this(in, charset, size, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(in, charset, size, logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level) {
-        this(in, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final Level level) {
+        this(in, charset, logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level, final Marker marker) {
-        this(in, charset, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(in, charset, logger, FQCN, level, marker);
     }
 
     public LoggerBufferedInputStream(final InputStream in, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
@@ -62,20 +61,20 @@ public class LoggerBufferedInputStream extends BufferedInputStream {
         this(in, Charset.defaultCharset(), size, logger, fqcn, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int size, final Logger logger, final Level level) {
-        this(in, size, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final int size, final ExtendedLogger logger, final Level level) {
+        this(in, size, logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int size, final Logger logger, final Level level, final Marker marker) {
-        this(in, size, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final int size, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(in, size, logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level) {
-        this(in, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final ExtendedLogger logger, final Level level) {
+        this(in, logger, FQCN, level, null);
     }
     
-    public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level, final Marker marker) {
-        this(in, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(in, logger, FQCN, level, marker);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
index db89101..2db1c8d 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
@@ -23,7 +23,6 @@ import java.io.Reader;
 import java.nio.CharBuffer;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
@@ -38,20 +37,20 @@ public class LoggerBufferedReader extends BufferedReader {
         super(new LoggerReader(reader, logger, FQCN, level, marker), size);
     }
 
-    public LoggerBufferedReader(final Reader reader, final int size, final Logger logger, final Level level) {
-        this(reader, size, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedReader(final Reader reader, final int size, final ExtendedLogger logger, final Level level) {
+        this(reader, size, logger, FQCN, level, null);
     }
 
-    public LoggerBufferedReader(final Reader reader, final int size, final Logger logger, final Level level, final Marker marker) {
-        this(reader, size, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedReader(final Reader reader, final int size, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(reader, size, logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level) {
-        this(reader, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedReader(final Reader reader, final ExtendedLogger logger, final Level level) {
+        this(reader, logger, FQCN, level, null);
     }
 
-    public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level, final Marker marker) {
-        this(reader, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedReader(final Reader reader, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(reader, logger, FQCN, level, marker);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
index 8fcb567..b4d242f 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
@@ -23,7 +23,6 @@ import java.io.InputStream;
 import java.nio.charset.Charset;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.ByteStreamLogger;
@@ -44,21 +43,21 @@ public class LoggerInputStream extends FilterInputStream {
         this.fqcn = fqcn;
     }
 
-    public LoggerInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level) {
-        this(in, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final Level level) {
+        this(in, charset, logger, FQCN, level, null);
     }
 
-    public LoggerInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level,
+    public LoggerInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final Level level,
             final Marker marker) {
-        this(in, charset, (ExtendedLogger) logger, FQCN, level, marker);
+        this(in, charset, logger, FQCN, level, marker);
     }
 
-    public LoggerInputStream(final InputStream in, final Logger logger, final Level level) {
-        this(in, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerInputStream(final InputStream in, final ExtendedLogger logger, final Level level) {
+        this(in, Charset.defaultCharset(), logger, FQCN, level, null);
     }
 
-    public LoggerInputStream(final InputStream in, final Logger logger, final Level level, final Marker marker) {
-        this(in, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerInputStream(final InputStream in, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(in, Charset.defaultCharset(), logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
index 391fd01..1bfc857 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
@@ -40,20 +40,20 @@ public class LoggerOutputStream extends OutputStream {
     private final ByteStreamLogger logger;
     private final String fqcn;
 
-    public LoggerOutputStream(final Charset charset, final Logger logger, final Level level) {
-        this(null, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerOutputStream(final Charset charset, final ExtendedLogger logger, final Level level) {
+        this(null, charset, logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final Charset charset, final Logger logger, final Level level, final Marker marker) {
-        this(null, charset, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerOutputStream(final Charset charset, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(null, charset, logger, FQCN, level, marker);
     }
 
-    public LoggerOutputStream(final Logger logger, final Level level) {
-        this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerOutputStream(final ExtendedLogger logger, final Level level) {
+        this(null, Charset.defaultCharset(), logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final Logger logger, final Level level, final Marker marker) {
-        this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerOutputStream(final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(null, Charset.defaultCharset(), logger, FQCN, level, marker);
     }
 
     public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger,
@@ -63,21 +63,21 @@ public class LoggerOutputStream extends OutputStream {
         this.fqcn = fqcn;
     }
 
-    public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level) {
-        this(out, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final Level level) {
+        this(out, charset, logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level,
+    public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final Level level,
             final Marker marker) {
-        this(out, charset, (ExtendedLogger) logger, FQCN, level, marker);
+        this(out, charset, logger, FQCN, level, marker);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Logger logger, final Level level) {
-        this(out, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerOutputStream(final OutputStream out, final ExtendedLogger logger, final Level level) {
+        this(out, Charset.defaultCharset(), logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Logger logger, final Level level, final Marker marker) {
-        this(out, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerOutputStream(final OutputStream out, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(out, Charset.defaultCharset(), logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
index 6792502..a407b49 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
@@ -25,7 +25,6 @@ import java.nio.charset.Charset;
 import java.util.Locale;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
@@ -38,22 +37,22 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 public class LoggerPrintStream extends PrintStream {
     private static final String FQCN = LoggerPrintStream.class.getName();
 
-    public LoggerPrintStream(final Charset charset, final Logger logger, final Level level)
+    public LoggerPrintStream(final Charset charset, final ExtendedLogger logger, final Level level)
             throws UnsupportedEncodingException {
-        this(null, false, charset, (ExtendedLogger) logger, FQCN, level, null);
+        this(null, false, charset, logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final Charset charset, final Logger logger, final Level level, final Marker marker)
+    public LoggerPrintStream(final Charset charset, final ExtendedLogger logger, final Level level, final Marker marker)
             throws UnsupportedEncodingException {
-        this(null, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
+        this(null, false, charset, logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final Logger logger, final Level level) {
-        this(null, false, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final ExtendedLogger logger, final Level level) {
+        this(null, false, logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final Logger logger, final Level level, final Marker marker) {
-        this(null, false, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerPrintStream(final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(null, false, logger, FQCN, level, marker);
     }
 
     public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset,
@@ -63,13 +62,13 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset,
-            final Logger logger, final Level level) throws UnsupportedEncodingException {
-        this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, null);
+            final ExtendedLogger logger, final Level level) throws UnsupportedEncodingException {
+        this(out, autoFlush, charset, logger, FQCN, level, null);
     }
 
     public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset,
-            final Logger logger, final Level level, final Marker marker) throws UnsupportedEncodingException {
-        this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, marker);
+            final ExtendedLogger logger, final Level level, final Marker marker) throws UnsupportedEncodingException {
+        this(out, autoFlush, charset, logger, FQCN, level, marker);
     }
 
     public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger,
@@ -77,31 +76,31 @@ public class LoggerPrintStream extends PrintStream {
         super(new LoggerOutputStream(out, Charset.defaultCharset(), logger, fqcn, level, marker), autoFlush);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level) {
-        this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger, final Level level) {
+        this(out, autoFlush, logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level,
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger, final Level level,
             final Marker marker) {
-        this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
+        this(out, autoFlush, logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level)
+    public LoggerPrintStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final Level level)
             throws UnsupportedEncodingException {
-        this(out, false, charset, (ExtendedLogger) logger, FQCN, level, null);
+        this(out, false, charset, logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level,
+    public LoggerPrintStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final Level level,
             final Marker marker) throws UnsupportedEncodingException {
-        this(out, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
+        this(out, false, charset, logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Logger logger, final Level level) {
-        this(out, false, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final OutputStream out, final ExtendedLogger logger, final Level level) {
+        this(out, false, logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Logger logger, final Level level, final Marker marker) {
-        this(out, false, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerPrintStream(final OutputStream out, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(out, false, logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index 4e014c8..cb9b350 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -22,7 +22,6 @@ import java.io.Writer;
 import java.util.Locale;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
@@ -32,7 +31,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
  * <p>
  * Integration with JDBC logging can be as simple as:
  * </p>
- * <pre>DriverManager.setLogWriter(new LoggerPrintWriter(LogManager.getLogger(), Level.DEBUG));
+ * <pre>DriverManager.setLogWriter(new LoggerPrintWriter((ExtendedLogger) LogManager.getLogger(), Level.DEBUG));
  * </pre>
  */
 public class LoggerPrintWriter extends PrintWriter {
@@ -44,12 +43,12 @@ public class LoggerPrintWriter extends PrintWriter {
         super(new LoggerWriter(logger, fqcn, level, marker), autoFlush);
     }
 
-    public LoggerPrintWriter(final Logger logger, final Level level) {
-        this((ExtendedLogger) logger, false, FQCN, level, null);
+    public LoggerPrintWriter(final ExtendedLogger logger, final Level level) {
+        this(logger, false, FQCN, level, null);
     }
 
-    public LoggerPrintWriter(final Logger logger, final Level level, final Marker marker) {
-        this((ExtendedLogger) logger, false, FQCN, level, marker);
+    public LoggerPrintWriter(final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(logger, false, FQCN, level, marker);
     }
 
     @SuppressWarnings("resource")
@@ -58,21 +57,21 @@ public class LoggerPrintWriter extends PrintWriter {
         super(new LoggerWriterFilter(writer, logger, fqcn, level, marker), autoFlush);
     }
 
-    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final Logger logger, final Level level) {
-        this(writer, autoFlush, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final Level level) {
+        this(writer, autoFlush, logger, FQCN, level, null);
     }
 
-    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final Logger logger, final Level level,
+    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final Level level,
             final Marker marker) {
-        this(writer, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
+        this(writer, autoFlush, logger, FQCN, level, marker);
     }
 
-    public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level) {
-        this(writer, false, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintWriter(final Writer writer, final ExtendedLogger logger, final Level level) {
+        this(writer, false, logger, FQCN, level, null);
     }
 
-    public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level, final Marker marker) {
-        this(writer, false, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerPrintWriter(final Writer writer, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(writer, false, logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
index f364c46..33a36de 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
@@ -23,7 +23,6 @@ import java.io.Reader;
 import java.nio.CharBuffer;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
@@ -45,12 +44,12 @@ public class LoggerReader extends FilterReader {
         this.fqcn = fqcn;
     }
 
-    public LoggerReader(final Reader reader, final Logger logger, final Level level) {
-        this(reader, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerReader(final Reader reader, final ExtendedLogger logger, final Level level) {
+        this(reader, logger, FQCN, level, null);
     }
 
-    public LoggerReader(final Reader reader, final Logger logger, final Level level, final Marker marker) {
-        this(reader, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerReader(final Reader reader, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(reader, logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index 2adbeb8..3a99c28 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -25,18 +25,18 @@ import java.io.Writer;
 import java.nio.charset.Charset;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.spi.ExtendedLogger;
 
 public class LoggerStreams {
 
     public static class BufferedBuilder {
-        private final Logger logger;
+        private final ExtendedLogger logger;
         private final Level level;
         private final Marker marker;
         private final int size;
 
-        BufferedBuilder(final Logger logger, final Level level, final Marker marker, final int size) {
+        BufferedBuilder(final ExtendedLogger logger, final Level level, final Marker marker, final int size) {
             this.logger = logger;
             this.level = level;
             this.marker = marker;
@@ -74,11 +74,11 @@ public class LoggerStreams {
     }
 
     public static class Builder {
-        private final Logger logger;
+        private final ExtendedLogger logger;
         private final Level level;
         private final Marker marker;
 
-        Builder(final Logger logger, final Level level, final Marker marker) {
+        Builder(final ExtendedLogger logger, final Level level, final Marker marker) {
             this.logger = logger;
             this.level = level;
             this.marker = marker;
@@ -102,12 +102,12 @@ public class LoggerStreams {
     }
 
     public static class PrintingBuilder {
-        private final Logger logger;
+        private final ExtendedLogger logger;
         private final Level level;
         private final Marker marker;
         private final boolean autoFlush;
 
-        PrintingBuilder(final Logger logger, final Level level, final Marker marker, final boolean autoFlush) {
+        PrintingBuilder(final ExtendedLogger logger, final Level level, final Marker marker, final boolean autoFlush) {
             this.logger = logger;
             this.level = level;
             this.marker = marker;
@@ -144,27 +144,27 @@ public class LoggerStreams {
         }
     }
 
-    public static Builder debug(final Logger logger) {
+    public static Builder debug(final ExtendedLogger logger) {
         return new Builder(logger, Level.DEBUG, null);
     }
 
-    public static Builder error(final Logger logger) {
+    public static Builder error(final ExtendedLogger logger) {
         return new Builder(logger, Level.ERROR, null);
     }
 
-    public static Builder fatal(final Logger logger) {
+    public static Builder fatal(final ExtendedLogger logger) {
         return new Builder(logger, Level.FATAL, null);
     }
 
-    public static Builder info(final Logger logger) {
+    public static Builder info(final ExtendedLogger logger) {
         return new Builder(logger, Level.INFO, null);
     }
 
-    public static Builder trace(final Logger logger) {
+    public static Builder trace(final ExtendedLogger logger) {
         return new Builder(logger, Level.TRACE, null);
     }
 
-    public static Builder warn(final Logger logger) {
+    public static Builder warn(final ExtendedLogger logger) {
         return new Builder(logger, Level.WARN, null);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index 22bac96..53d9324 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.io.Writer;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
@@ -41,12 +40,12 @@ public class LoggerWriter extends Writer {
         this.fqcn = fqcn;
     }
 
-    public LoggerWriter(final Logger logger, final Level level) {
-        this((ExtendedLogger) logger, FQCN, level, null);
+    public LoggerWriter(final ExtendedLogger logger, final Level level) {
+        this(logger, FQCN, level, null);
     }
 
-    public LoggerWriter(final Logger logger, final Level level, final Marker marker) {
-        this((ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerWriter(final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
index a219ba5..0ecc719 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.Writer;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
@@ -44,12 +43,12 @@ public class LoggerWriterFilter extends FilterWriter {
         this.fqcn = fqcn;
     }
 
-    public LoggerWriterFilter(final Writer out, final Logger logger, final Level level) {
-        this(out, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final Level level) {
+        this(out, logger, FQCN, level, null);
     }
 
-    public LoggerWriterFilter(final Writer out, final Logger logger, final Level level, final Marker marker) {
-        this(out, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(out, logger, FQCN, level, marker);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
index 46535ab..78b13fd 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
@@ -70,7 +70,7 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
         out.close();
         replay(out);
 
-        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
+        final LoggerOutputStream los = new LoggerOutputStream(out, getExtendedLogger(), LEVEL);
         los.flush();
         los.close();
         verify(out);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
index 17d5c72..3fd6658 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
@@ -26,14 +26,21 @@ import java.util.List;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.test.appender.ListAppender;
 import org.junit.Before;
 import org.junit.ClassRule;
 
 public abstract class AbstractStreamTest {
+    
     protected static Logger getLogger() {
+        return getExtendedLogger();
+    }
+    
+    protected static ExtendedLogger getExtendedLogger() {
         return ctx.getLogger("UnitTestLogger");
     }
+    
     protected final static String NEWLINE = System.getProperty("line.separator");
     protected final static Level LEVEL = Level.ERROR;
     protected final static String FIRST = "first";

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
index 8c18243..b11a31a 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
@@ -24,6 +24,6 @@ public class LoggerBufferedInputStreamTest extends LoggerInputStreamTest {
 
     @Override
     protected InputStream createInputStream() {
-        return new LoggerBufferedInputStream(this.wrapped, getLogger(), Level.ERROR);
+        return new LoggerBufferedInputStream(this.wrapped, getExtendedLogger(), Level.ERROR);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
index 5765d4e..1e4ecc8 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
@@ -28,7 +28,7 @@ public class LoggerBufferedReaderTest extends LoggerReaderTest {
     
     @Override
     protected Reader createReader() {
-        return this.bufferedReader = new LoggerBufferedReader(this.wrapped, getLogger(), LEVEL);
+        return this.bufferedReader = new LoggerBufferedReader(this.wrapped, getExtendedLogger(), LEVEL);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
index 602601b..30ec88a 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
@@ -33,7 +33,7 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
     protected InputStream in;
 
     protected InputStream createInputStream() {
-        return new LoggerInputStream(this.wrapped, getLogger(), LEVEL);
+        return new LoggerInputStream(this.wrapped, getExtendedLogger(), LEVEL);
     }
 
     @Before
@@ -55,7 +55,7 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
     @Test
     public void testClose_NoRemainingData() throws IOException {
         this.wrapped = new ByteArrayInputStream((FIRST + '\n').getBytes());
-        this.in = new LoggerInputStream(this.wrapped, getLogger(), LEVEL);
+        this.in = new LoggerInputStream(this.wrapped, getExtendedLogger(), LEVEL);
 
         final byte[] bytes = new byte[1024];
         this.in.read(bytes);
@@ -116,7 +116,7 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
     @Test
     public void testRead_MultipleLines() throws IOException {
         this.wrapped = new ByteArrayInputStream((FIRST + "\n" + LAST + '\n').getBytes());
-        this.in = new LoggerInputStream(this.wrapped, getLogger(), LEVEL);
+        this.in = new LoggerInputStream(this.wrapped, getExtendedLogger(), LEVEL);
 
         final byte[] bytes = new byte[1024];
         final int len = this.in.read(bytes);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
index a42c5bb..115d57e 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
@@ -34,7 +34,7 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
     protected OutputStream out;
 
     protected OutputStream createOutputStream() {
-        return new LoggerOutputStream(this.wrapped, getLogger(), Level.ERROR);
+        return new LoggerOutputStream(this.wrapped, getExtendedLogger(), Level.ERROR);
     }
 
     @Before
@@ -66,7 +66,7 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
         out.close();
         replay(out);
         
-        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
+        final LoggerOutputStream los = new LoggerOutputStream(out, getExtendedLogger(), LEVEL);
         los.flush();
         los.close();
         verify(out);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
index 399738d..812043a 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
@@ -28,7 +28,7 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
 
     @Override
     protected OutputStream createOutputStream() {
-        return this.print = new LoggerPrintStream(this.wrapped, getLogger(), LEVEL);
+        return this.print = new LoggerPrintStream(this.wrapped, getExtendedLogger(), LEVEL);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index 5e46e65..d10b962 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -35,7 +35,7 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
 
     @Override
     protected Writer createWriterWrapper() {
-        this.print = new LoggerPrintWriter(this.wrapped, getLogger(), LEVEL);
+        this.print = new LoggerPrintWriter(this.wrapped, getExtendedLogger(), LEVEL);
         return this.print;
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
index 6ca45a9..662c8be 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
@@ -34,7 +34,7 @@ public class LoggerReaderTest extends AbstractStreamTest {
     protected Reader reader;
 
     protected Reader createReader() {
-        return new LoggerReader(this.wrapped, getLogger(), LEVEL);
+        return new LoggerReader(this.wrapped, getExtendedLogger(), LEVEL);
     }
     
     @Before

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
index d55bf66..93827b1 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
@@ -12,7 +12,7 @@ public class LoggerWriterFilterTest extends AbstractLoggerWriterTest {
 
     @Override
     protected Writer createWriterWrapper() {
-        return new LoggerWriterFilter(this.wrapped, getLogger(), LEVEL);
+        return new LoggerWriterFilter(this.wrapped, getExtendedLogger(), LEVEL);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c682ad5d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
index 42a474b..8378348 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
@@ -28,7 +28,7 @@ public class LoggerWriterTest extends AbstractLoggerWriterTest {
 
     @Override
     protected Writer createWriterWrapper() {
-        return new LoggerWriter(getLogger(), LEVEL);
+        return new LoggerWriter(getExtendedLogger(), LEVEL);
     }
 
 }


[29/29] git commit: Merge branch 'master' into LOG4J2-608

Posted by ma...@apache.org.
Merge branch 'master' into LOG4J2-608


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/228da65c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/228da65c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/228da65c

Branch: refs/heads/LOG4J2-608
Commit: 228da65cdcddbe399a73262d9d8ee7ffda81769f
Parents: 48024c8 9c87854
Author: Matt Sicker <ma...@apache.org>
Authored: Tue Sep 2 20:37:13 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Tue Sep 2 20:37:13 2014 -0500

----------------------------------------------------------------------
 log4j-api/.gitignore                            |   1 +
 .../logging/log4j/streams/ByteStreamLogger.java | 150 --------------
 .../logging/log4j/streams/CharStreamLogger.java | 110 ----------
 .../streams/LoggerBufferedInputStream.java      |  51 +++--
 .../log4j/streams/LoggerBufferedReader.java     |  25 ++-
 .../log4j/streams/LoggerFilterWriter.java       |  99 +++++++++
 .../log4j/streams/LoggerInputStream.java        |  50 ++---
 .../log4j/streams/LoggerOutputStream.java       |  99 +++++----
 .../log4j/streams/LoggerPrintStream.java        | 206 ++++++++++---------
 .../log4j/streams/LoggerPrintWriter.java        | 181 ++++++++--------
 .../logging/log4j/streams/LoggerReader.java     |  43 ++--
 .../logging/log4j/streams/LoggerStreams.java    | 152 +++++++-------
 .../logging/log4j/streams/LoggerWriter.java     |  84 +++-----
 .../log4j/streams/helpers/ByteStreamLogger.java | 150 --------------
 .../log4j/streams/helpers/CharStreamLogger.java | 110 ----------
 .../log4j/streams/util/ByteStreamLogger.java    | 152 ++++++++++++++
 .../log4j/streams/util/CharStreamLogger.java    | 110 ++++++++++
 .../log4j/streams/AbstractLoggerWriterTest.java | 138 +++++++++++++
 .../log4j/streams/AbstractStreamTest.java       |  66 ++++++
 ...LoggerBufferedInputStreamCallerInfoTest.java |  32 +--
 .../streams/LoggerBufferedInputStreamTest.java  |   2 +-
 .../LoggerBufferedReaderCallerInfoTest.java     |  40 ++--
 .../log4j/streams/LoggerBufferedReaderTest.java |   8 +-
 .../log4j/streams/LoggerFilterWriterTest.java   |  18 ++
 .../LoggerInputStreamCallerInfoTest.java        |  24 +--
 .../log4j/streams/LoggerInputStreamTest.java    | 108 +++++-----
 .../LoggerOutputStreamCallerInfoTest.java       |  14 +-
 .../log4j/streams/LoggerOutputStreamTest.java   | 112 +++++-----
 .../LoggerPrintStreamCallerInfoTest.java        | 102 ++++-----
 .../log4j/streams/LoggerPrintStreamTest.java    |  84 ++++----
 .../LoggerPrintWriterCallerInfoTest.java        | 102 ++++-----
 .../log4j/streams/LoggerPrintWriterTest.java    |  94 +++++----
 .../streams/LoggerReaderCallerInfoTest.java     |  26 +--
 .../logging/log4j/streams/LoggerReaderTest.java | 118 +++++------
 .../streams/LoggerStreamsCallerInfoTesting.java |  22 +-
 .../logging/log4j/streams/LoggerWriterTest.java | 104 +---------
 .../logging/log4j/streams/StreamTesting.java    |  61 ------
 pom.xml                                         |   4 +-
 src/changes/changes.xml                         |   3 +
 39 files changed, 1480 insertions(+), 1575 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/228da65c/pom.xml
----------------------------------------------------------------------


[02/29] git commit: Git ignore felix-cache.

Posted by ma...@apache.org.
Git ignore felix-cache.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6a6ba886
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6a6ba886
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6a6ba886

Branch: refs/heads/LOG4J2-608
Commit: 6a6ba886193d40a3006f9d7520ff078e8ab97dc5
Parents: 6269f97
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 08:31:00 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 08:31:00 2014 -0400

----------------------------------------------------------------------
 log4j-api/.gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6a6ba886/log4j-api/.gitignore
----------------------------------------------------------------------
diff --git a/log4j-api/.gitignore b/log4j-api/.gitignore
index 9f0fc21..4a239e5 100644
--- a/log4j-api/.gitignore
+++ b/log4j-api/.gitignore
@@ -2,3 +2,4 @@
 /target/
 /.classpath
 /.project
+/felix-cache/


[05/29] git commit: Use 'this.'.

Posted by ma...@apache.org.
Use 'this.'.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3fd8320a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3fd8320a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3fd8320a

Branch: refs/heads/LOG4J2-608
Commit: 3fd8320a803f801c4ba4348fa974781acc7c27a8
Parents: f25c539
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 09:24:05 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 09:24:05 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/streams/ByteStreamLogger.java  | 4 ++--
 .../apache/logging/log4j/streams/helpers/ByteStreamLogger.java   | 4 ++--
 .../apache/logging/log4j/streams/LoggerBufferedReaderTest.java   | 2 +-
 .../org/apache/logging/log4j/streams/LoggerPrintStreamTest.java  | 2 +-
 .../org/apache/logging/log4j/streams/LoggerPrintWriterTest.java  | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3fd8320a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
index 24b62da..80f401c 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
@@ -44,8 +44,8 @@ public class ByteStreamLogger {
         this.logger = logger;
         this.level = level;
         this.marker = marker;
-        this.in = new ByteBufferInputStream();
-        this.reader = new InputStreamReader(in, charset);
+        in = new ByteBufferInputStream();
+        reader = new InputStreamReader(in, charset);
     }
 
     public void put(final String fqcn, final int b) throws IOException {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3fd8320a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
index e9ee5b8..1157ea5 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
@@ -44,8 +44,8 @@ public class ByteStreamLogger {
         this.logger = logger;
         this.level = level;
         this.marker = marker;
-        this.in = new ByteBufferInputStream();
-        this.reader = new InputStreamReader(in, charset);
+        in = new ByteBufferInputStream();
+        reader = new InputStreamReader(in, charset);
     }
 
     public void put(final String fqcn, final int b) throws IOException {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3fd8320a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
index ebbe2d3..a69355b 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
@@ -28,7 +28,7 @@ public class LoggerBufferedReaderTest extends LoggerReaderTest {
     
     @Override
     protected Reader createReader() {
-        return this.reader = new LoggerBufferedReader(wrapped, getLogger(), LEVEL);
+        return reader = new LoggerBufferedReader(wrapped, getLogger(), LEVEL);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3fd8320a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
index b793910..1f5e324 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
@@ -28,7 +28,7 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
 
     @Override
     protected OutputStream createOutputStream() {
-        return this.print = new LoggerPrintStream(wrapped, getLogger(), LEVEL);
+        return print = new LoggerPrintStream(wrapped, getLogger(), LEVEL);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3fd8320a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index 2e33a37..e46f840 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -29,8 +29,8 @@ public class LoggerPrintWriterTest extends LoggerWriterTest {
 
     @Override
     protected Writer createWriter() {
-        this.print = new LoggerPrintWriter(wrapped, getLogger(), LEVEL);
-        return this.print;
+        print = new LoggerPrintWriter(wrapped, getLogger(), LEVEL);
+        return print;
     }
 
     @Test


[17/29] git commit: Add 'this' qualifier to unqualified field accesses.

Posted by ma...@apache.org.
Add 'this' qualifier to unqualified field accesses.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7f969fa7
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7f969fa7
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7f969fa7

Branch: refs/heads/LOG4J2-608
Commit: 7f969fa7af0a0bfbc882c379b70fd2f82a3021bd
Parents: a15493a
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:36:30 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:36:30 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/ByteStreamLogger.java | 60 ++++++++---------
 .../logging/log4j/streams/CharStreamLogger.java | 24 +++----
 .../streams/LoggerBufferedInputStream.java      |  2 +-
 .../log4j/streams/LoggerInputStream.java        |  8 +--
 .../log4j/streams/LoggerOutputStream.java       | 30 ++++-----
 .../log4j/streams/LoggerPrintStream.java        |  2 +-
 .../log4j/streams/LoggerPrintWriter.java        |  2 +-
 .../logging/log4j/streams/LoggerReader.java     |  8 +--
 .../logging/log4j/streams/LoggerStreams.java    | 40 +++++------
 .../logging/log4j/streams/LoggerWriter.java     | 14 ++--
 .../log4j/streams/LoggerWriterFilter.java       | 28 ++++----
 .../log4j/streams/util/ByteStreamLogger.java    | 60 ++++++++---------
 .../log4j/streams/util/CharStreamLogger.java    | 24 +++----
 .../log4j/streams/AbstractLoggerWriterTest.java | 58 ++++++++--------
 ...LoggerBufferedInputStreamCallerInfoTest.java | 18 ++---
 .../streams/LoggerBufferedInputStreamTest.java  |  2 +-
 .../LoggerBufferedReaderCallerInfoTest.java     | 26 ++++----
 .../log4j/streams/LoggerBufferedReaderTest.java |  6 +-
 .../LoggerInputStreamCallerInfoTest.java        | 14 ++--
 .../log4j/streams/LoggerInputStreamTest.java    | 60 ++++++++---------
 .../LoggerOutputStreamCallerInfoTest.java       | 14 ++--
 .../log4j/streams/LoggerOutputStreamTest.java   | 48 +++++++-------
 .../LoggerPrintStreamCallerInfoTest.java        | 54 +++++++--------
 .../log4j/streams/LoggerPrintStreamTest.java    | 56 ++++++++--------
 .../LoggerPrintWriterCallerInfoTest.java        | 54 +++++++--------
 .../log4j/streams/LoggerPrintWriterTest.java    | 58 ++++++++--------
 .../streams/LoggerReaderCallerInfoTest.java     | 16 ++---
 .../logging/log4j/streams/LoggerReaderTest.java | 70 ++++++++++----------
 .../log4j/streams/LoggerWriterFilterTest.java   |  2 +-
 29 files changed, 429 insertions(+), 429 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
index 83e8c3b..bbc9098 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
@@ -32,24 +32,24 @@ public class ByteStreamLogger {
 
         @Override
         public int read() throws IOException {
-            buf.flip();
+            ByteStreamLogger.this.buf.flip();
             int result = -1;
-            if (buf.limit() > 0) {
-                result = buf.get() & 0xFF;
+            if (ByteStreamLogger.this.buf.limit() > 0) {
+                result = ByteStreamLogger.this.buf.get() & 0xFF;
             }
-            buf.compact();
+            ByteStreamLogger.this.buf.compact();
             return result;
         }
 
         @Override
         public int read(final byte[] bytes, final int off, final int len) throws IOException {
-            buf.flip();
+            ByteStreamLogger.this.buf.flip();
             int result = -1;
-            if (buf.limit() > 0) {
-                result = Math.min(len, buf.limit());
-                buf.get(bytes, off, result);
+            if (ByteStreamLogger.this.buf.limit() > 0) {
+                result = Math.min(len, ByteStreamLogger.this.buf.limit());
+                ByteStreamLogger.this.buf.get(bytes, off, result);
             }
-            buf.compact();
+            ByteStreamLogger.this.buf.compact();
             return result;
         }
     }
@@ -70,66 +70,66 @@ public class ByteStreamLogger {
         this.logger = logger;
         this.level = level;
         this.marker = marker;
-        in = new ByteBufferInputStream();
-        reader = new InputStreamReader(in, charset);
+        this.in = new ByteBufferInputStream();
+        this.reader = new InputStreamReader(this.in, charset);
     }
 
     public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
+        synchronized (this.msg) {
+            this.closed = true;
             logEnd(fqcn);
 //            in.close();
         }
     }
 
     private void extractMessages(final String fqcn) throws IOException {
-        if (closed) {
+        if (this.closed) {
             return;
         }
-        int read = reader.read(msgBuf);
+        int read = this.reader.read(this.msgBuf);
         while (read > 0) {
             int off = 0;
             for (int pos = 0; pos < read; pos++) {
-                switch (msgBuf[pos]) {
+                switch (this.msgBuf[pos]) {
                 case '\r':
-                    msg.append(msgBuf, off, pos - off);
+                    this.msg.append(this.msgBuf, off, pos - off);
                     off = pos + 1;
                     break;
                 case '\n':
-                    msg.append(msgBuf, off, pos - off);
+                    this.msg.append(this.msgBuf, off, pos - off);
                     off = pos + 1;
                     log(fqcn);
                     break;
                 }
             }
-            msg.append(msgBuf, off, read - off);
-            read = reader.read(msgBuf);
+            this.msg.append(this.msgBuf, off, read - off);
+            read = this.reader.read(this.msgBuf);
         }
     }
 
     private void log(final String fqcn) {
         // convert to string now so async loggers work
-        logger.logIfEnabled(fqcn, level, marker, msg.toString());
-        msg.setLength(0);
+        this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString());
+        this.msg.setLength(0);
     }
     
     private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
+        if (this.msg.length() > 0) {
             log(fqcn);
         }
     }
 
     public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
         if (len >= 0) {
-            synchronized (msg) {
-                while (len > buf.remaining()) {
-                    final int remaining = buf.remaining();
-                    buf.put(b, off, remaining);
+            synchronized (this.msg) {
+                while (len > this.buf.remaining()) {
+                    final int remaining = this.buf.remaining();
+                    this.buf.put(b, off, remaining);
                     len -= remaining;
                     off += remaining;
                     extractMessages(fqcn);
                 }
-                buf.put(b, off, len);
+                this.buf.put(b, off, len);
                 extractMessages(fqcn);
             }
         } else {
@@ -139,8 +139,8 @@ public class ByteStreamLogger {
 
     public void put(final String fqcn, final int b) throws IOException {
         if (b >= 0) {
-            synchronized (msg) {
-                buf.put((byte) (b & 0xFF));
+            synchronized (this.msg) {
+                this.buf.put((byte) (b & 0xFF));
                 extractMessages(fqcn);
             }
         } else {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
index d141752..b46cf85 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
@@ -37,20 +37,20 @@ public class CharStreamLogger {
     }
 
     public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
+        synchronized (this.msg) {
+            this.closed = true;
             logEnd(fqcn);
         }
     }
 
     private void log(final String fqcn) {
-        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
+        this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString()); // convert to string now so async loggers
                                                          // work
-        msg.setLength(0);
+        this.msg.setLength(0);
     }
 
     private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
+        if (this.msg.length() > 0) {
             log(fqcn);
         }
     }
@@ -61,8 +61,8 @@ public class CharStreamLogger {
 
     public void put(final String fqcn, final CharSequence str, final int off, final int len) {
         if (len >= 0) {
-            synchronized (msg) {
-                if (closed) {
+            synchronized (this.msg) {
+                if (this.closed) {
                     return;
                 }
                 int start = off;
@@ -72,7 +72,7 @@ public class CharStreamLogger {
                     switch (c) {
                     case '\r':
                     case '\n':
-                        msg.append(str, start, pos);
+                        this.msg.append(str, start, pos);
                         start = pos + 1;
                         if (c == '\n') {
                             log(fqcn);
@@ -80,7 +80,7 @@ public class CharStreamLogger {
                         break;
                     }
                 }
-                msg.append(str, start, end);
+                this.msg.append(str, start, end);
             }
         } else {
             logEnd(fqcn);
@@ -89,8 +89,8 @@ public class CharStreamLogger {
 
     public void put(final String fqcn, final int c) {
         if (c >= 0) {
-            synchronized (msg) {
-                if (closed) {
+            synchronized (this.msg) {
+                if (this.closed) {
                     return;
                 }
                 switch (c) {
@@ -100,7 +100,7 @@ public class CharStreamLogger {
                 case '\r':
                     break;
                 default:
-                    msg.append((char) c);
+                    this.msg.append((char) c);
                 }
             }
         } else {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
index 26f59ff..74b8918 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
@@ -100,6 +100,6 @@ public class LoggerBufferedInputStream extends BufferedInputStream {
 
     @Override
     public String toString() {
-        return LoggerBufferedInputStream.class.getSimpleName() + "{stream=" + in + '}';
+        return LoggerBufferedInputStream.class.getSimpleName() + "{stream=" + this.in + '}';
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
index 1ac53ae..8fcb567 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
@@ -63,14 +63,14 @@ public class LoggerInputStream extends FilterInputStream {
 
     @Override
     public void close() throws IOException {
-        logger.close(fqcn);
+        this.logger.close(this.fqcn);
         super.close();
     }
 
     @Override
     public int read() throws IOException {
         final int b = super.read();
-        logger.put(fqcn, b);
+        this.logger.put(this.fqcn, b);
         return b;
     }
 
@@ -82,12 +82,12 @@ public class LoggerInputStream extends FilterInputStream {
     @Override
     public int read(final byte[] b, final int off, final int len) throws IOException {
         final int bytesRead = super.read(b, off, len);
-        logger.put(fqcn, b, off, bytesRead);
+        this.logger.put(this.fqcn, b, off, bytesRead);
         return bytesRead;
     }
 
     @Override
     public String toString() {
-        return LoggerInputStream.class.getSimpleName() + "{stream=" + in + '}';
+        return LoggerInputStream.class.getSimpleName() + "{stream=" + this.in + '}';
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
index b10f805..391fd01 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
@@ -82,45 +82,45 @@ public class LoggerOutputStream extends OutputStream {
 
     @Override
     public void close() throws IOException {
-        if (out != null) {
-            out.close();
+        if (this.out != null) {
+            this.out.close();
         }
-        logger.close(fqcn);
+        this.logger.close(this.fqcn);
     }
 
     @Override
     public void flush() throws IOException {
-        if (out != null) {
-            out.flush();
+        if (this.out != null) {
+            this.out.flush();
         }
     }
 
     @Override
     public String toString() {
-        return LoggerOutputStream.class.getSimpleName() + "{stream=" + out + '}';
+        return LoggerOutputStream.class.getSimpleName() + "{stream=" + this.out + '}';
     }
 
     @Override
     public void write(final byte[] b) throws IOException {
-        if (out != null) {
-            out.write(b);
+        if (this.out != null) {
+            this.out.write(b);
         }
-        logger.put(fqcn, b, 0, b.length);
+        this.logger.put(this.fqcn, b, 0, b.length);
     }
 
     @Override
     public void write(final byte[] b, final int off, final int len) throws IOException {
-        if (out != null) {
-            out.write(b, off, len);
+        if (this.out != null) {
+            this.out.write(b, off, len);
         }
-        logger.put(fqcn, b, off, len);
+        this.logger.put(this.fqcn, b, off, len);
     }
 
     @Override
     public void write(final int b) throws IOException {
-        if (out != null) {
-            out.write(b);
+        if (this.out != null) {
+            this.out.write(b);
         }
-        logger.put(fqcn, (byte) (b & 0xFF));
+        this.logger.put(this.fqcn, (byte) (b & 0xFF));
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
index ad7fcb7..6792502 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
@@ -258,7 +258,7 @@ public class LoggerPrintStream extends PrintStream {
 
     @Override
     public String toString() {
-        return LoggerPrintStream.class.getSimpleName() + "{stream=" + out + '}';
+        return LoggerPrintStream.class.getSimpleName() + "{stream=" + this.out + '}';
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index b0861ed..4e014c8 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -229,7 +229,7 @@ public class LoggerPrintWriter extends PrintWriter {
 
     @Override
     public String toString() {
-        return LoggerPrintWriter.class.getSimpleName() + "{stream=" + out + '}';
+        return LoggerPrintWriter.class.getSimpleName() + "{stream=" + this.out + '}';
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
index d156f67..f364c46 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
@@ -56,13 +56,13 @@ public class LoggerReader extends FilterReader {
     @Override
     public void close() throws IOException {
         super.close();
-        logger.close(fqcn);
+        this.logger.close(this.fqcn);
     }
 
     @Override
     public int read() throws IOException {
         final int c = super.read();
-        logger.put(fqcn, c);
+        this.logger.put(this.fqcn, c);
         return c;
     }
 
@@ -74,7 +74,7 @@ public class LoggerReader extends FilterReader {
     @Override
     public int read(final char[] cbuf, final int off, final int len) throws IOException {
         final int charsRead = super.read(cbuf, off, len);
-        logger.put(fqcn, cbuf, off, charsRead);
+        this.logger.put(this.fqcn, cbuf, off, charsRead);
         return charsRead;
     }
 
@@ -91,6 +91,6 @@ public class LoggerReader extends FilterReader {
 
     @Override
     public String toString() {
-        return LoggerReader.class.getSimpleName() + "{stream=" + in + '}';
+        return LoggerReader.class.getSimpleName() + "{stream=" + this.in + '}';
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index 82bc946..4aa6483 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -44,32 +44,32 @@ public class LoggerStreams {
         }
 
         public LoggerBufferedInputStream create(final InputStream in) {
-            if (size > 0) {
-                return new LoggerBufferedInputStream(in, size, logger, level, marker);
+            if (this.size > 0) {
+                return new LoggerBufferedInputStream(in, this.size, this.logger, this.level, this.marker);
             }
-            return new LoggerBufferedInputStream(in, logger, level, marker);
+            return new LoggerBufferedInputStream(in, this.logger, this.level, this.marker);
         }
 
         public LoggerBufferedInputStream create(final InputStream in, final Charset charset) {
-            if (size > 0) {
-                return new LoggerBufferedInputStream(in, charset, size, logger, level, marker);
+            if (this.size > 0) {
+                return new LoggerBufferedInputStream(in, charset, this.size, this.logger, this.level, this.marker);
             }
-            return new LoggerBufferedInputStream(in, charset, logger, level, marker);
+            return new LoggerBufferedInputStream(in, charset, this.logger, this.level, this.marker);
         }
 
         public LoggerBufferedReader create(final Reader reader) {
-            if (size > 0) {
-                return new LoggerBufferedReader(reader, size, logger, level, marker);
+            if (this.size > 0) {
+                return new LoggerBufferedReader(reader, this.size, this.logger, this.level, this.marker);
             }
-            return new LoggerBufferedReader(reader, logger, level, marker);
+            return new LoggerBufferedReader(reader, this.logger, this.level, this.marker);
         }
 
         public BufferedBuilder marker(final Marker marker) {
-            return new BufferedBuilder(logger, level, marker, size);
+            return new BufferedBuilder(this.logger, this.level, marker, this.size);
         }
 
         public BufferedBuilder size(final int size) {
-            return new BufferedBuilder(logger, level, marker, size);
+            return new BufferedBuilder(this.logger, this.level, this.marker, size);
         }
     }
 
@@ -85,19 +85,19 @@ public class LoggerStreams {
         }
 
         public BufferedBuilder buffered() {
-            return new BufferedBuilder(logger, level, marker, 0);
+            return new BufferedBuilder(this.logger, this.level, this.marker, 0);
         }
 
         public LoggerWriterFilter create(final Writer writer) {
-            return new LoggerWriterFilter(writer, logger, level, marker);
+            return new LoggerWriterFilter(writer, this.logger, this.level, this.marker);
         }
 
         public Builder marker(final Marker marker) {
-            return new Builder(logger, level, marker);
+            return new Builder(this.logger, this.level, marker);
         }
 
         public PrintingBuilder printing() {
-            return new PrintingBuilder(logger, level, marker, false);
+            return new PrintingBuilder(this.logger, this.level, this.marker, false);
         }
     }
 
@@ -119,16 +119,16 @@ public class LoggerStreams {
         }
 
         public PrintingBuilder autoFlush(final boolean autoFlush) {
-            return new PrintingBuilder(logger, level, marker, autoFlush);
+            return new PrintingBuilder(this.logger, this.level, this.marker, autoFlush);
         }
 
         public LoggerPrintStream create(final OutputStream out) {
-            return new LoggerPrintStream(out, autoFlush, logger, level, marker);
+            return new LoggerPrintStream(out, this.autoFlush, this.logger, this.level, this.marker);
         }
 
         public LoggerPrintStream create(final OutputStream out, final Charset charset) {
             try {
-                return new LoggerPrintStream(out, autoFlush, charset, logger, level, marker);
+                return new LoggerPrintStream(out, this.autoFlush, charset, this.logger, this.level, this.marker);
             } catch (final UnsupportedEncodingException e) {
                 // Should never occur because the constructor must throw this
                 throw new IllegalArgumentException("Invalid charset", e);
@@ -136,11 +136,11 @@ public class LoggerStreams {
         }
 
         public LoggerPrintWriter create(final Writer writer) {
-            return new LoggerPrintWriter(writer, autoFlush, logger, level, marker);
+            return new LoggerPrintWriter(writer, this.autoFlush, this.logger, this.level, this.marker);
         }
 
         public PrintingBuilder marker(final Marker marker) {
-            return new PrintingBuilder(logger, level, marker, autoFlush);
+            return new PrintingBuilder(this.logger, this.level, marker, this.autoFlush);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index d663fc2..291ee45 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -51,7 +51,7 @@ public class LoggerWriter extends Writer {
 
     @Override
     public void close() throws IOException {
-        logger.close(fqcn);
+        this.logger.close(this.fqcn);
     }
 
     @Override
@@ -60,31 +60,31 @@ public class LoggerWriter extends Writer {
 
     @Override
     public String toString() {
-        return this.getClass().getSimpleName() + "[fqcn=" + fqcn + ", logger=" + logger + "]";
+        return this.getClass().getSimpleName() + "[fqcn=" + this.fqcn + ", logger=" + this.logger + "]";
     }
 
     @Override
     public void write(final char[] cbuf) throws IOException {
-        logger.put(fqcn, cbuf, 0, cbuf.length);
+        this.logger.put(this.fqcn, cbuf, 0, cbuf.length);
     }
 
     @Override
     public void write(final char[] cbuf, final int off, final int len) throws IOException {
-        logger.put(fqcn, cbuf, off, len);
+        this.logger.put(this.fqcn, cbuf, off, len);
     }
 
     @Override
     public void write(final int c) throws IOException {
-        logger.put(fqcn, (char) c);
+        this.logger.put(this.fqcn, (char) c);
     }
 
     @Override
     public void write(final String str) throws IOException {
-        logger.put(fqcn, str, 0, str.length());
+        this.logger.put(this.fqcn, str, 0, str.length());
     }
 
     @Override
     public void write(final String str, final int off, final int len) throws IOException {
-        logger.put(fqcn, str, off, len);
+        this.logger.put(this.fqcn, str, off, len);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
index 858ac11..a219ba5 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
@@ -54,47 +54,47 @@ public class LoggerWriterFilter extends FilterWriter {
 
     @Override
     public void close() throws IOException {
-        out.close();
-        logger.close(fqcn);
+        this.out.close();
+        this.logger.close(this.fqcn);
     }
 
     @Override
     public void flush() throws IOException {
-        out.flush();
+        this.out.flush();
     }
 
     @Override
     public String toString() {
-        return LoggerWriterFilter.class.getSimpleName() + "{writer=" + out + '}';
+        return LoggerWriterFilter.class.getSimpleName() + "{writer=" + this.out + '}';
     }
 
     @Override
     public void write(final char[] cbuf) throws IOException {
-        out.write(cbuf);
-        logger.put(fqcn, cbuf, 0, cbuf.length);
+        this.out.write(cbuf);
+        this.logger.put(this.fqcn, cbuf, 0, cbuf.length);
     }
 
     @Override
     public void write(final char[] cbuf, final int off, final int len) throws IOException {
-        out.write(cbuf, off, len);
-        logger.put(fqcn, cbuf, off, len);
+        this.out.write(cbuf, off, len);
+        this.logger.put(this.fqcn, cbuf, off, len);
     }
 
     @Override
     public void write(final int c) throws IOException {
-        out.write(c);
-        logger.put(fqcn, (char) c);
+        this.out.write(c);
+        this.logger.put(this.fqcn, (char) c);
     }
 
     @Override
     public void write(final String str) throws IOException {
-        out.write(str);
-        logger.put(fqcn, str, 0, str.length());
+        this.out.write(str);
+        this.logger.put(this.fqcn, str, 0, str.length());
     }
 
     @Override
     public void write(final String str, final int off, final int len) throws IOException {
-        out.write(str, off, len);
-        logger.put(fqcn, str, off, len);
+        this.out.write(str, off, len);
+        this.logger.put(this.fqcn, str, off, len);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
index 655497b..27c7319 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
@@ -32,24 +32,24 @@ public class ByteStreamLogger {
 
         @Override
         public int read() throws IOException {
-            buf.flip();
+            ByteStreamLogger.this.buf.flip();
             int result = -1;
-            if (buf.limit() > 0) {
-                result = buf.get() & 0xFF;
+            if (ByteStreamLogger.this.buf.limit() > 0) {
+                result = ByteStreamLogger.this.buf.get() & 0xFF;
             }
-            buf.compact();
+            ByteStreamLogger.this.buf.compact();
             return result;
         }
 
         @Override
         public int read(final byte[] bytes, final int off, final int len) throws IOException {
-            buf.flip();
+            ByteStreamLogger.this.buf.flip();
             int result = -1;
-            if (buf.limit() > 0) {
-                result = Math.min(len, buf.limit());
-                buf.get(bytes, off, result);
+            if (ByteStreamLogger.this.buf.limit() > 0) {
+                result = Math.min(len, ByteStreamLogger.this.buf.limit());
+                ByteStreamLogger.this.buf.get(bytes, off, result);
             }
-            buf.compact();
+            ByteStreamLogger.this.buf.compact();
             return result;
         }
     }
@@ -70,66 +70,66 @@ public class ByteStreamLogger {
         this.logger = logger;
         this.level = level;
         this.marker = marker;
-        in = new ByteBufferInputStream();
-        reader = new InputStreamReader(in, charset);
+        this.in = new ByteBufferInputStream();
+        this.reader = new InputStreamReader(this.in, charset);
     }
 
     public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
+        synchronized (this.msg) {
+            this.closed = true;
             logEnd(fqcn);
 //            in.close();
         }
     }
 
     private void extractMessages(final String fqcn) throws IOException {
-        if (closed) {
+        if (this.closed) {
             return;
         }
-        int read = reader.read(msgBuf);
+        int read = this.reader.read(this.msgBuf);
         while (read > 0) {
             int off = 0;
             for (int pos = 0; pos < read; pos++) {
-                switch (msgBuf[pos]) {
+                switch (this.msgBuf[pos]) {
                 case '\r':
-                    msg.append(msgBuf, off, pos - off);
+                    this.msg.append(this.msgBuf, off, pos - off);
                     off = pos + 1;
                     break;
                 case '\n':
-                    msg.append(msgBuf, off, pos - off);
+                    this.msg.append(this.msgBuf, off, pos - off);
                     off = pos + 1;
                     log(fqcn);
                     break;
                 }
             }
-            msg.append(msgBuf, off, read - off);
-            read = reader.read(msgBuf);
+            this.msg.append(this.msgBuf, off, read - off);
+            read = this.reader.read(this.msgBuf);
         }
     }
 
     private void log(final String fqcn) {
         // convert to string now so async loggers work
-        logger.logIfEnabled(fqcn, level, marker, msg.toString());
-        msg.setLength(0);
+        this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString());
+        this.msg.setLength(0);
     }
     
     private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
+        if (this.msg.length() > 0) {
             log(fqcn);
         }
     }
 
     public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
         if (len >= 0) {
-            synchronized (msg) {
-                while (len > buf.remaining()) {
-                    final int remaining = buf.remaining();
-                    buf.put(b, off, remaining);
+            synchronized (this.msg) {
+                while (len > this.buf.remaining()) {
+                    final int remaining = this.buf.remaining();
+                    this.buf.put(b, off, remaining);
                     len -= remaining;
                     off += remaining;
                     extractMessages(fqcn);
                 }
-                buf.put(b, off, len);
+                this.buf.put(b, off, len);
                 extractMessages(fqcn);
             }
         } else {
@@ -139,8 +139,8 @@ public class ByteStreamLogger {
 
     public void put(final String fqcn, final int b) throws IOException {
         if (b >= 0) {
-            synchronized (msg) {
-                buf.put((byte) (b & 0xFF));
+            synchronized (this.msg) {
+                this.buf.put((byte) (b & 0xFF));
                 extractMessages(fqcn);
             }
         } else {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
index 71b63ce..ffe2c17 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
@@ -37,20 +37,20 @@ public class CharStreamLogger {
     }
 
     public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
+        synchronized (this.msg) {
+            this.closed = true;
             logEnd(fqcn);
         }
     }
 
     private void log(final String fqcn) {
         // convert to string now so async loggers work
-        logger.logIfEnabled(fqcn, level, marker, msg.toString());
-        msg.setLength(0);
+        this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString());
+        this.msg.setLength(0);
     }
 
     private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
+        if (this.msg.length() > 0) {
             log(fqcn);
         }
     }
@@ -61,8 +61,8 @@ public class CharStreamLogger {
 
     public void put(final String fqcn, final CharSequence str, final int off, final int len) {
         if (len >= 0) {
-            synchronized (msg) {
-                if (closed) {
+            synchronized (this.msg) {
+                if (this.closed) {
                     return;
                 }
                 int start = off;
@@ -72,7 +72,7 @@ public class CharStreamLogger {
                     switch (c) {
                     case '\r':
                     case '\n':
-                        msg.append(str, start, pos);
+                        this.msg.append(str, start, pos);
                         start = pos + 1;
                         if (c == '\n') {
                             log(fqcn);
@@ -80,7 +80,7 @@ public class CharStreamLogger {
                         break;
                     }
                 }
-                msg.append(str, start, end);
+                this.msg.append(str, start, end);
             }
         } else {
             logEnd(fqcn);
@@ -89,8 +89,8 @@ public class CharStreamLogger {
 
     public void put(final String fqcn, final int c) {
         if (c >= 0) {
-            synchronized (msg) {
-                if (closed) {
+            synchronized (this.msg) {
+                if (this.closed) {
                     return;
                 }
                 switch (c) {
@@ -100,7 +100,7 @@ public class CharStreamLogger {
                 case '\r':
                     break;
                 default:
-                    msg.append((char) c);
+                    this.msg.append((char) c);
                 }
             }
         } else {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
index f62360f..46535ab 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
@@ -35,8 +35,8 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
 
     @Before
     public void createStream() {
-        wrapped = createWriter();
-        writer = createWriterWrapper();
+        this.wrapped = createWriter();
+        this.writer = createWriterWrapper();
     }
 
     protected abstract StringWriter createWriter();
@@ -45,21 +45,21 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
 
     @Test
     public void testClose_HasRemainingData() throws IOException {
-        writer.write(FIRST);
+        this.writer.write(FIRST);
         assertMessages();
-        writer.close();
+        this.writer.close();
         assertMessages(FIRST);
-        if (wrapped != null) {
-            assertEquals(FIRST, wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals(FIRST, this.wrapped.toString());
         }
     }
 
     @Test
     public void testClose_NoRemainingData() throws IOException {
-        writer.close();
+        this.writer.close();
         assertMessages();
-        if (wrapped != null) {
-            assertEquals("", wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals("", this.wrapped.toString());
         }
     }
 
@@ -79,25 +79,25 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
     @Test
     public void testWrite_Character() throws Exception {
         for (final char c : FIRST.toCharArray()) {
-            writer.write(c);
+            this.writer.write(c);
             assertMessages();
         }
-        writer.write('\n');
+        this.writer.write('\n');
         assertMessages(FIRST);
-        if (wrapped != null) {
-            assertEquals(FIRST + '\n', wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals(FIRST + '\n', this.wrapped.toString());
         }
     }
 
     @Test
     public void testWrite_CharArray() throws Exception {
         final char[] chars = FIRST.toCharArray();
-        writer.write(chars);
+        this.writer.write(chars);
         assertMessages();
-        writer.write('\n');
+        this.writer.write('\n');
         assertMessages(FIRST);
-        if (wrapped != null) {
-            assertEquals(FIRST + '\n', wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals(FIRST + '\n', this.wrapped.toString());
         }
     }
 
@@ -107,32 +107,32 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
         final int middle = chars.length / 2;
         final int length = chars.length - middle;
         final String right = new String(chars, middle, length);
-        writer.write(chars, middle, length);
+        this.writer.write(chars, middle, length);
         assertMessages();
-        writer.write('\n');
+        this.writer.write('\n');
         assertMessages(right);
-        if (wrapped != null) {
-            assertEquals(FIRST.substring(middle, FIRST.length()) + '\n', wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals(FIRST.substring(middle, FIRST.length()) + '\n', this.wrapped.toString());
         }
     }
 
     @Test
     public void testWrite_IgnoresWindowsNewline() throws IOException {
-        writer.write(FIRST + "\r\n");
-        writer.write(LAST);
-        writer.close();
+        this.writer.write(FIRST + "\r\n");
+        this.writer.write(LAST);
+        this.writer.close();
         assertMessages(FIRST, LAST);
-        if (wrapped != null) {
-            assertEquals(FIRST + "\r\n" + LAST, wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals(FIRST + "\r\n" + LAST, this.wrapped.toString());
         }
     }
 
     @Test
     public void testWrite_MultipleLines() throws IOException {
-        writer.write(FIRST + '\n' + LAST + '\n');
+        this.writer.write(FIRST + '\n' + LAST + '\n');
         assertMessages(FIRST, LAST);
-        if (wrapped != null) {
-            assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
+        if (this.wrapped != null) {
+            assertEquals(FIRST + '\n' + LAST + '\n', this.wrapped.toString());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
index 07df463..079deb1 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
@@ -28,39 +28,39 @@ public class LoggerBufferedInputStreamCallerInfoTest extends LoggerStreamsCaller
     
     @Test
     public void close() throws Exception {
-        logIn.read();
+        this.logIn.read();
         assertMessages("before close", 3, "close");
-        logIn.close();
+        this.logIn.close();
         assertMessages("after close", 4, "close");
     }
     
     @Test
     public void read() throws Exception {
-        logIn.read();
+        this.logIn.read();
 
         assertMessages("read", 3, "read");
-        logIn.close();
+        this.logIn.close();
     }
 
     @Test
     public void readBytes() throws Exception {
-        logIn.read(new byte[2]);
+        this.logIn.read(new byte[2]);
 
         assertMessages("read", 3, "readBytes");
-        logIn.close();
+        this.logIn.close();
     }
 
     @Test
     public void readBytesOffsetLen() throws Exception {
-        logIn.read(new byte[2], 0, 2);
+        this.logIn.read(new byte[2], 0, 2);
 
         assertMessages("read", 3, "readBytesOffsetLen");
-        logIn.close();
+        this.logIn.close();
     }
 
     @Before
     public void setupStreams() {
         final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
-        logIn = new LoggerBufferedInputStream(srcInputStream, getLogger(), LEVEL);
+        this.logIn = new LoggerBufferedInputStream(srcInputStream, getLogger(), LEVEL);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
index e6d60f0..8c18243 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamTest.java
@@ -24,6 +24,6 @@ public class LoggerBufferedInputStreamTest extends LoggerInputStreamTest {
 
     @Override
     protected InputStream createInputStream() {
-        return new LoggerBufferedInputStream(wrapped, getLogger(), Level.ERROR);
+        return new LoggerBufferedInputStream(this.wrapped, getLogger(), Level.ERROR);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
index 44850dd..b723651 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
@@ -30,55 +30,55 @@ public class LoggerBufferedReaderCallerInfoTest extends LoggerStreamsCallerInfoT
     
     @Test
     public void close() throws Exception {
-        logReader.readLine();
+        this.logReader.readLine();
         assertMessages("before close", 3, "close");
-        logReader.close();
+        this.logReader.close();
         assertMessages("after close", 4, "close");
     }
 
     @Test
     public void read() throws Exception {
-        logReader.read();
+        this.logReader.read();
 
         assertMessages("read", 3, "read");
-        logReader.close();
+        this.logReader.close();
     }
 
     @Test
     public void readCbuf() throws Exception {
-        logReader.read(new char[2]);
+        this.logReader.read(new char[2]);
 
         assertMessages("read", 3, "readCbuf");
-        logReader.close();
+        this.logReader.close();
     }
 
     @Test
     public void readCbufOffset() throws Exception {
-        logReader.read(new char[2], 0, 2);
+        this.logReader.read(new char[2], 0, 2);
 
         assertMessages("read", 3, "readCbufOffset");
-        logReader.close();
+        this.logReader.close();
     }
 
     @Test
     public void readCharBuffer() throws Exception {
-        logReader.read(CharBuffer.allocate(2));
+        this.logReader.read(CharBuffer.allocate(2));
 
         assertMessages("read", 3, "readCharBuffer");
-        logReader.close();
+        this.logReader.close();
     }
 
     @Test
     public void readLine() throws Exception {
-        logReader.readLine();
+        this.logReader.readLine();
 
         assertMessages("read", 3, "readLine");
-        logReader.close();
+        this.logReader.close();
     }
 
     @Before
     public void setupReader() {
         final Reader srcReader = new StringReader("a\nb\nc\nd");
-        logReader = new LoggerBufferedReader(srcReader, getLogger(), Level.WARN);
+        this.logReader = new LoggerBufferedReader(srcReader, getLogger(), Level.WARN);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
index a69355b..d6b6782 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
@@ -28,14 +28,14 @@ public class LoggerBufferedReaderTest extends LoggerReaderTest {
     
     @Override
     protected Reader createReader() {
-        return reader = new LoggerBufferedReader(wrapped, getLogger(), LEVEL);
+        return this.reader = new LoggerBufferedReader(this.wrapped, getLogger(), LEVEL);
     }
 
     @Test
     public void testReadLine() throws Exception {
-        assertEquals("first line", FIRST, reader.readLine());
+        assertEquals("first line", FIRST, this.reader.readLine());
         assertMessages(FIRST);
-        assertEquals("second line", LAST, reader.readLine());
+        assertEquals("second line", LAST, this.reader.readLine());
         assertMessages(FIRST, LAST);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
index 1c68548..6037c3e 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
@@ -29,26 +29,26 @@ public class LoggerInputStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
     
     @Test
     public void read() throws Exception {
-        logIn.read();
+        this.logIn.read();
         assertMessages("before read int size", 0, "read");
-        logIn.read();
+        this.logIn.read();
         assertMessages("after read int size", 1, "read");
 
-        logIn.read(new byte[2]);
+        this.logIn.read(new byte[2]);
         assertMessages("after read bytes size", 2, "read");
 
-        logIn.read(new byte[2], 0, 2);
+        this.logIn.read(new byte[2], 0, 2);
         assertMessages("after read bytes offset size", 3, "read");
 
-        logIn.read();
+        this.logIn.read();
         assertMessages("before close size", 3, "read");
-        logIn.close();
+        this.logIn.close();
         assertMessages("after close size", 4, "read");
     }
     
     @Before
     public void setupStreams() {
         final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
-        logIn = new LoggerInputStream(srcInputStream, getLogger(), Level.WARN);
+        this.logIn = new LoggerInputStream(srcInputStream, getLogger(), Level.WARN);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
index 4c0741d..602601b 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
@@ -33,95 +33,95 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
     protected InputStream in;
 
     protected InputStream createInputStream() {
-        return new LoggerInputStream(wrapped, getLogger(), LEVEL);
+        return new LoggerInputStream(this.wrapped, getLogger(), LEVEL);
     }
 
     @Before
     public void createStream() {
-        wrapped = new ByteArrayInputStream((FIRST + "\r\n" + LAST).getBytes());
-        read = new ByteArrayOutputStream();
-        in = createInputStream();
+        this.wrapped = new ByteArrayInputStream((FIRST + "\r\n" + LAST).getBytes());
+        this.read = new ByteArrayOutputStream();
+        this.in = createInputStream();
     }
     
     @Test
     public void testClose_HasRemainingData() throws IOException {
         final byte[] bytes = new byte[1024];
-        in.read(bytes);
+        this.in.read(bytes);
         assertMessages(FIRST);
-        in.close();
+        this.in.close();
         assertMessages(FIRST, LAST);
     }
 
     @Test
     public void testClose_NoRemainingData() throws IOException {
-        wrapped = new ByteArrayInputStream((FIRST + '\n').getBytes());
-        in = new LoggerInputStream(wrapped, getLogger(), LEVEL);
+        this.wrapped = new ByteArrayInputStream((FIRST + '\n').getBytes());
+        this.in = new LoggerInputStream(this.wrapped, getLogger(), LEVEL);
 
         final byte[] bytes = new byte[1024];
-        in.read(bytes);
+        this.in.read(bytes);
         assertMessages(FIRST);
-        in.close();
+        this.in.close();
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_ByteArray() throws Exception {
         final byte[] bytes = new byte[FIRST.length()];
-        assertEquals("len", bytes.length, in.read(bytes));
-        if (!(in instanceof BufferedInputStream)) {
+        assertEquals("len", bytes.length, this.in.read(bytes));
+        if (!(this.in instanceof BufferedInputStream)) {
             assertMessages();
         }
-        in.read(bytes);
+        this.in.read(bytes);
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_ByteArray_Offset_Length() throws Exception {
         final byte[] bytes = new byte[FIRST.length() * 2];
-        assertEquals("len", FIRST.length(), in.read(bytes, 0, FIRST.length()));
-        if (!(in instanceof BufferedInputStream)) {
+        assertEquals("len", FIRST.length(), this.in.read(bytes, 0, FIRST.length()));
+        if (!(this.in instanceof BufferedInputStream)) {
             assertMessages();
         }
-        in.read(bytes);
+        this.in.read(bytes);
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_IgnoresWindowsNewline() throws IOException {
         final byte[] bytes = new byte[1024];
-        final int len = in.read(bytes);
-        read.write(bytes, 0, len);
+        final int len = this.in.read(bytes);
+        this.read.write(bytes, 0, len);
         assertMessages(FIRST);
-        assertEquals(FIRST + "\r\n" + LAST, read.toString());
-        in.close();
+        assertEquals(FIRST + "\r\n" + LAST, this.read.toString());
+        this.in.close();
         assertMessages(FIRST, LAST);
     }
 
     @Test
     public void testRead_int() throws Exception {
         for (int i = 0; i < FIRST.length(); i++) {
-            read.write(in.read());
+            this.read.write(this.in.read());
         }
-        if (!(in instanceof BufferedInputStream)) {
+        if (!(this.in instanceof BufferedInputStream)) {
             assertMessages();
         }
-        assertEquals("carriage return", '\r', in.read());
-        if (!(in instanceof BufferedInputStream)) {
+        assertEquals("carriage return", '\r', this.in.read());
+        if (!(this.in instanceof BufferedInputStream)) {
             assertMessages();
         }
-        assertEquals("newline", '\n', in.read());
+        assertEquals("newline", '\n', this.in.read());
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_MultipleLines() throws IOException {
-        wrapped = new ByteArrayInputStream((FIRST + "\n" + LAST + '\n').getBytes());
-        in = new LoggerInputStream(wrapped, getLogger(), LEVEL);
+        this.wrapped = new ByteArrayInputStream((FIRST + "\n" + LAST + '\n').getBytes());
+        this.in = new LoggerInputStream(this.wrapped, getLogger(), LEVEL);
 
         final byte[] bytes = new byte[1024];
-        final int len = in.read(bytes);
-        read.write(bytes, 0, len);
+        final int len = this.in.read(bytes);
+        this.read.write(bytes, 0, len);
         assertMessages(FIRST, LAST);
-        assertEquals(FIRST + '\n' + LAST + '\n', read.toString());
+        assertEquals(FIRST + '\n' + LAST + '\n', this.read.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamCallerInfoTest.java
index 662aae4..3a38753 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamCallerInfoTest.java
@@ -26,25 +26,25 @@ public class LoggerOutputStreamCallerInfoTest extends LoggerStreamsCallerInfoTes
     
     @Before
     public void setupStreams() {
-        logOut = new LoggerOutputStream(getLogger(), Level.WARN);
+        this.logOut = new LoggerOutputStream(getLogger(), Level.WARN);
     }
     
     @Test
     public void write() throws Exception {
-        logOut.write('a');
+        this.logOut.write('a');
         assertMessages("before write int", 0, "write");
-        logOut.write('\n');
+        this.logOut.write('\n');
         assertMessages("after write int", 1, "write");
         
-        logOut.write("b\n".getBytes());
+        this.logOut.write("b\n".getBytes());
         assertMessages("after write byte array", 2, "write");
 
-        logOut.write("c\n".getBytes(), 0, 2);
+        this.logOut.write("c\n".getBytes(), 0, 2);
         assertMessages("after write byte array offset size", 3, "write");
 
-        logOut.write('d');
+        this.logOut.write('d');
         assertMessages("before close size", 3, "write");
-        logOut.close();
+        this.logOut.close();
         assertMessages("after close size", 4, "write");
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
index 8a3d238..a42c5bb 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
@@ -34,29 +34,29 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
     protected OutputStream out;
 
     protected OutputStream createOutputStream() {
-        return new LoggerOutputStream(wrapped, getLogger(), Level.ERROR);
+        return new LoggerOutputStream(this.wrapped, getLogger(), Level.ERROR);
     }
 
     @Before
     public void createStream() {
-        wrapped = new ByteArrayOutputStream();
-        out = createOutputStream();
+        this.wrapped = new ByteArrayOutputStream();
+        this.out = createOutputStream();
     }
 
     @Test
     public void testClose_HasRemainingData() throws IOException {
-        out.write(FIRST.getBytes());
+        this.out.write(FIRST.getBytes());
         assertMessages();
-        out.close();
+        this.out.close();
         assertMessages(FIRST);
-        assertEquals(FIRST, wrapped.toString());
+        assertEquals(FIRST, this.wrapped.toString());
     }
 
     @Test
     public void testClose_NoRemainingData() throws IOException {
-        out.close();
+        this.out.close();
         assertMessages();
-        assertEquals("", wrapped.toString());
+        assertEquals("", this.wrapped.toString());
     }
 
     @Test
@@ -75,11 +75,11 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
     @Test
     public void testWrite_ByteArray() throws Exception {
         final byte[] bytes = "byte[]".getBytes();
-        out.write(bytes);
+        this.out.write(bytes);
         assertMessages();
-        out.write('\n');
+        this.out.write('\n');
         assertMessages("byte[]");
-        assertEquals("byte[]\n", wrapped.toString());
+        assertEquals("byte[]\n", this.wrapped.toString());
     }
 
     @Test
@@ -88,38 +88,38 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
         final int middle = bytes.length/2;
         final int length = bytes.length - middle;
         final String right = new String(bytes, middle, length);
-        out.write(bytes, middle, length);
+        this.out.write(bytes, middle, length);
         assertMessages();
-        out.write('\n');
+        this.out.write('\n');
         assertMessages(right);
-        assertEquals("byte[]".substring(middle, bytes.length) + '\n', wrapped.toString());
+        assertEquals("byte[]".substring(middle, bytes.length) + '\n', this.wrapped.toString());
     }
 
     @Test
     public void testWrite_IgnoresWindowsNewline() throws IOException {
-        out.write(FIRST.getBytes());
-        out.write("\r\n".getBytes());
-        out.write(LAST.getBytes());
-        out.close();
+        this.out.write(FIRST.getBytes());
+        this.out.write("\r\n".getBytes());
+        this.out.write(LAST.getBytes());
+        this.out.close();
         assertMessages(FIRST, LAST);
-        assertEquals(FIRST + "\r\n" + LAST, wrapped.toString());
+        assertEquals(FIRST + "\r\n" + LAST, this.wrapped.toString());
     }
 
     @Test
     public void testWrite_Int() throws Exception {
         for (final byte b : "int".getBytes()) {
-            out.write(b);
+            this.out.write(b);
             assertMessages();
         }
-        out.write('\n');
+        this.out.write('\n');
         assertMessages("int");
-        assertEquals("int" + '\n', wrapped.toString());
+        assertEquals("int" + '\n', this.wrapped.toString());
     }
 
     @Test
     public void testWrite_MultipleLines() throws IOException {
-        out.write((FIRST + '\n' + LAST + '\n').getBytes());
+        this.out.write((FIRST + '\n' + LAST + '\n').getBytes());
         assertMessages(FIRST, LAST);
-        assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
+        assertEquals(FIRST + '\n' + LAST + '\n', this.wrapped.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
index e2c7f2b..21d8b58 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
@@ -28,118 +28,118 @@ public class LoggerPrintStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
     
     @Test
     public void close() throws Exception {
-        logOut.print("a\nb");
+        this.logOut.print("a\nb");
         assertMessages("before close size", 1, "close");
-        logOut.close();
+        this.logOut.close();
         assertMessages("after close size", 2, "close");
     }
     
     @Test
     public void print_boolean() throws Exception {
-        logOut.print(true);
+        this.logOut.print(true);
         assertMessages("print", 0, "print_boolean");
-        logOut.println(true);
+        this.logOut.println(true);
         assertMessages("println", 1, "print_boolean");
     }
     
     @Test
     public void print_char() throws Exception {
-        logOut.print('a');
+        this.logOut.print('a');
         assertMessages("print", 0, "print_char");
-        logOut.println('b');
+        this.logOut.println('b');
         assertMessages("println", 1, "print_char");
     }
     
     @Test
     public void print_chararray() throws Exception {
-        logOut.print("a".toCharArray());
+        this.logOut.print("a".toCharArray());
         assertMessages("print", 0, "print_chararray");
-        logOut.println("b".toCharArray());
+        this.logOut.println("b".toCharArray());
         assertMessages("println", 1, "print_chararray");
     }
     
     @Test
     public void print_double() throws Exception {
-        logOut.print(1D);
+        this.logOut.print(1D);
         assertMessages("print", 0, "print_double");
-        logOut.println(2D);
+        this.logOut.println(2D);
         assertMessages("println", 1, "print_double");
     }
     
     @Test
     public void print_float() throws Exception {
-        logOut.print(1f);
+        this.logOut.print(1f);
         assertMessages("print", 0, "print_float");
-        logOut.println(2f);
+        this.logOut.println(2f);
         assertMessages("println", 1, "print_float");
     }
     
     @Test
     public void print_int() throws Exception {
-        logOut.print(1);
+        this.logOut.print(1);
         assertMessages("print", 0, "print_int");
-        logOut.println(2);
+        this.logOut.println(2);
         assertMessages("println", 1, "print_int");
     }
     
     @Test
     public void print_long() throws Exception {
-        logOut.print(1L);
+        this.logOut.print(1L);
         assertMessages("print", 0, "print_long");
-        logOut.println(2L);
+        this.logOut.println(2L);
         assertMessages("println", 1, "print_long");
     }
     
     @Test
     public void print_object() throws Exception {
-        logOut.print((Object) 'a');
+        this.logOut.print((Object) 'a');
         assertMessages("print", 0, "print_object");
-        logOut.println((Object) 'b');
+        this.logOut.println((Object) 'b');
         assertMessages("println", 1, "print_object");
     }
     
     @Test
     public void print_printf() throws Exception {
-        logOut.printf("a\n");
+        this.logOut.printf("a\n");
         assertMessages("println", 1, "print_printf");
     }
     
     @Test
     public void print_printf_locale() throws Exception {
-        logOut.printf(Locale.getDefault(), "a\n");
+        this.logOut.printf(Locale.getDefault(), "a\n");
         assertMessages("println", 1, "print_printf_locale");
     }
     
     @Test
     public void print_string() throws Exception {
-        logOut.print("a");
+        this.logOut.print("a");
         assertMessages("print", 0, "print_string");
-        logOut.println("b");
+        this.logOut.println("b");
         assertMessages("println", 1, "print_string");
     }
     
     @Before
     public void setupStreams() {
-        logOut = new LoggerPrintStream(getLogger(), Level.WARN);
+        this.logOut = new LoggerPrintStream(getLogger(), Level.WARN);
     }
     
     @Test
     public void write_bytes() throws Exception {
-        logOut.write("b\n".getBytes());
+        this.logOut.write("b\n".getBytes());
         assertMessages("write", 1, "write_bytes");
     }
     
     @Test
     public void write_bytes_offset() throws Exception {
-        logOut.write("c\n".getBytes(), 0, 2);
+        this.logOut.write("c\n".getBytes(), 0, 2);
         assertMessages("write", 1, "write_bytes_offset");
     }
     
     @Test
     public void write_int() throws Exception {
-        logOut.write('a');
+        this.logOut.write('a');
         assertMessages("write int", 0, "write_int");
-        logOut.write('\n');
+        this.logOut.write('\n');
         assertMessages("write newline", 1, "write_int");
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
index 864d300..399738d 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
@@ -28,89 +28,89 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
 
     @Override
     protected OutputStream createOutputStream() {
-        return print = new LoggerPrintStream(wrapped, getLogger(), LEVEL);
+        return this.print = new LoggerPrintStream(this.wrapped, getLogger(), LEVEL);
     }
 
     @Test
     public void testFormat() throws Exception {
-        assertSame(print, print.format("[%s]", FIRST));
+        assertSame(this.print, this.print.format("[%s]", FIRST));
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("[" + FIRST + "]");
-        assertEquals("[" + FIRST + "]" + NEWLINE, wrapped.toString());
+        assertEquals("[" + FIRST + "]" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_boolean() throws Exception {
-        print.print(true);
+        this.print.print(true);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("true");
-        assertEquals("true" + NEWLINE, wrapped.toString());
+        assertEquals("true" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_char() throws Exception {
         for (final char c : FIRST.toCharArray()) {
-            print.print(c);
+            this.print.print(c);
             assertMessages();
         }
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_CharacterArray() throws Exception {
-        print.print(FIRST.toCharArray());
+        this.print.print(FIRST.toCharArray());
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_int() throws Exception {
-        print.print(12);
+        this.print.print(12);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("12");
-        assertEquals("12" + NEWLINE, wrapped.toString());
+        assertEquals("12" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_long() throws Exception {
-        print.print(12L);
+        this.print.print(12L);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("12");
-        assertEquals("12" + NEWLINE, wrapped.toString());
+        assertEquals("12" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_Object() throws Exception {
-        print.print((Object) FIRST);
+        this.print.print((Object) FIRST);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_String() throws Exception {
-        print.print(FIRST);
+        this.print.print(FIRST);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrintf() throws Exception {
-        assertSame(print,  print.printf("<<<%s>>>", FIRST));
+        assertSame(this.print,  this.print.printf("<<<%s>>>", FIRST));
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("<<<" + FIRST + ">>>");
-        assertEquals("<<<" + FIRST + ">>>" + NEWLINE, wrapped.toString());
+        assertEquals("<<<" + FIRST + ">>>" + NEWLINE, this.wrapped.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
index f3133e2..16e271e 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
@@ -28,118 +28,118 @@ public class LoggerPrintWriterCallerInfoTest extends LoggerStreamsCallerInfoTest
     
     @Test
     public void close() throws Exception {
-        logOut.print("a\nb");
+        this.logOut.print("a\nb");
         assertMessages("before close size", 1, "close");
-        logOut.close();
+        this.logOut.close();
         assertMessages("after close size", 2, "close");
     }
     
     @Test
     public void print_boolean() throws Exception {
-        logOut.print(true);
+        this.logOut.print(true);
         assertMessages("print", 0, "print_boolean");
-        logOut.println(true);
+        this.logOut.println(true);
         assertMessages("println", 1, "print_boolean");
     }
     
     @Test
     public void print_char() throws Exception {
-        logOut.print('a');
+        this.logOut.print('a');
         assertMessages("print", 0, "print_char");
-        logOut.println('b');
+        this.logOut.println('b');
         assertMessages("println", 1, "print_char");
     }
     
     @Test
     public void print_chararray() throws Exception {
-        logOut.print("a".toCharArray());
+        this.logOut.print("a".toCharArray());
         assertMessages("print", 0, "print_chararray");
-        logOut.println("b".toCharArray());
+        this.logOut.println("b".toCharArray());
         assertMessages("println", 1, "print_chararray");
     }
     
     @Test
     public void print_double() throws Exception {
-        logOut.print(1D);
+        this.logOut.print(1D);
         assertMessages("print", 0, "print_double");
-        logOut.println(2D);
+        this.logOut.println(2D);
         assertMessages("println", 1, "print_double");
     }
     
     @Test
     public void print_float() throws Exception {
-        logOut.print(1f);
+        this.logOut.print(1f);
         assertMessages("print", 0, "print_float");
-        logOut.println(2f);
+        this.logOut.println(2f);
         assertMessages("println", 1, "print_float");
     }
     
     @Test
     public void print_int() throws Exception {
-        logOut.print(1);
+        this.logOut.print(1);
         assertMessages("print", 0, "print_int");
-        logOut.println(2);
+        this.logOut.println(2);
         assertMessages("println", 1, "print_int");
     }
     
     @Test
     public void print_long() throws Exception {
-        logOut.print(1L);
+        this.logOut.print(1L);
         assertMessages("print", 0, "print_long");
-        logOut.println(2L);
+        this.logOut.println(2L);
         assertMessages("println", 1, "print_long");
     }
     
     @Test
     public void print_object() throws Exception {
-        logOut.print((Object) 'a');
+        this.logOut.print((Object) 'a');
         assertMessages("print", 0, "print_object");
-        logOut.println((Object) 'b');
+        this.logOut.println((Object) 'b');
         assertMessages("println", 1, "print_object");
     }
     
     @Test
     public void print_printf() throws Exception {
-        logOut.printf("a\n");
+        this.logOut.printf("a\n");
         assertMessages("println", 1, "print_printf");
     }
     
     @Test
     public void print_printf_locale() throws Exception {
-        logOut.printf(Locale.getDefault(), "a\n");
+        this.logOut.printf(Locale.getDefault(), "a\n");
         assertMessages("println", 1, "print_printf_locale");
     }
     
     @Test
     public void print_string() throws Exception {
-        logOut.print("a");
+        this.logOut.print("a");
         assertMessages("print", 0, "print_string");
-        logOut.println("b");
+        this.logOut.println("b");
         assertMessages("println", 1, "print_string");
     }
     
     @Before
     public void setupStreams() {
-        logOut = new LoggerPrintWriter(getLogger(), Level.WARN);
+        this.logOut = new LoggerPrintWriter(getLogger(), Level.WARN);
     }
     
     @Test
     public void write_bytes() throws Exception {
-        logOut.write("b\n".toCharArray());
+        this.logOut.write("b\n".toCharArray());
         assertMessages("write", 1, "write_bytes");
     }
     
     @Test
     public void write_bytes_offset() throws Exception {
-        logOut.write("c\n".toCharArray(), 0, 2);
+        this.logOut.write("c\n".toCharArray(), 0, 2);
         assertMessages("write", 1, "write_bytes_offset");
     }
     
     @Test
     public void write_int() throws Exception {
-        logOut.write('a');
+        this.logOut.write('a');
         assertMessages("write int", 0, "write_int");
-        logOut.write('\n');
+        this.logOut.write('\n');
         assertMessages("write newline", 1, "write_int");
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index 7d1fac3..5e46e65 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -35,90 +35,90 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
 
     @Override
     protected Writer createWriterWrapper() {
-        print = new LoggerPrintWriter(wrapped, getLogger(), LEVEL);
-        return print;
+        this.print = new LoggerPrintWriter(this.wrapped, getLogger(), LEVEL);
+        return this.print;
     }
 
     @Test
     public void testFormat() throws Exception {
-        assertSame(print, print.format("[%s]", FIRST));
+        assertSame(this.print, this.print.format("[%s]", FIRST));
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("[" + FIRST + "]");
-        assertEquals("[" + FIRST + "]" + NEWLINE, wrapped.toString());
+        assertEquals("[" + FIRST + "]" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_boolean() throws Exception {
-        print.print(true);
+        this.print.print(true);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("true");
-        assertEquals("true" + NEWLINE, wrapped.toString());
+        assertEquals("true" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_char() throws Exception {
         for (final char c : FIRST.toCharArray()) {
-            print.print(c);
+            this.print.print(c);
             assertMessages();
         }
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_CharacterArray() throws Exception {
-        print.print(FIRST.toCharArray());
+        this.print.print(FIRST.toCharArray());
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_int() throws Exception {
-        print.print(12);
+        this.print.print(12);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("12");
-        assertEquals("12" + NEWLINE, wrapped.toString());
+        assertEquals("12" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_long() throws Exception {
-        print.print(12L);
+        this.print.print(12L);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("12");
-        assertEquals("12" + NEWLINE, wrapped.toString());
+        assertEquals("12" + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_Object() throws Exception {
-        print.print((Object) FIRST);
+        this.print.print((Object) FIRST);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrint_String() throws Exception {
-        print.print(FIRST);
+        this.print.print(FIRST);
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
+        assertEquals(FIRST + NEWLINE, this.wrapped.toString());
     }
 
     @Test
     public void testPrintf() throws Exception {
-        assertSame(print,  print.printf("<<<%s>>>", FIRST));
+        assertSame(this.print,  this.print.printf("<<<%s>>>", FIRST));
         assertMessages();
-        print.println();
+        this.print.println();
         assertMessages("<<<" + FIRST + ">>>");
-        assertEquals("<<<" + FIRST + ">>>" + NEWLINE, wrapped.toString());
+        assertEquals("<<<" + FIRST + ">>>" + NEWLINE, this.wrapped.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
index 18a8cdf..88c2311 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
@@ -29,29 +29,29 @@ public class LoggerReaderCallerInfoTest extends LoggerStreamsCallerInfoTesting {
     
     @Test
     public void read() throws Exception {
-        logReader.read();
+        this.logReader.read();
         assertMessages("before read int size", 0, "read");
-        logReader.read();
+        this.logReader.read();
         assertMessages("after read int size", 1, "read");
 
-        logReader.read(new char[2]);
+        this.logReader.read(new char[2]);
         assertMessages("after read bytes size", 2, "read");
 
-        logReader.read(new char[2], 0, 2);
+        this.logReader.read(new char[2], 0, 2);
         assertMessages("after read bytes offset size", 3, "read");
 
-        logReader.read(CharBuffer.allocate(2));
+        this.logReader.read(CharBuffer.allocate(2));
         assertMessages("after read charBuffer size", 4, "read");
 
-        logReader.read();
+        this.logReader.read();
         assertMessages("before close size", 4, "read");
-        logReader.close();
+        this.logReader.close();
         assertMessages("after close size", 5, "read");
     }
 
     @Before
     public void setupReader() {
         final Reader srcReader = new StringReader("a\nb\nc\nd\ne");
-        logReader = new LoggerReader(srcReader, getLogger(), LEVEL);
+        this.logReader = new LoggerReader(srcReader, getLogger(), LEVEL);
     }
 }


[20/29] git commit: Don't hide field from superclass.

Posted by ma...@apache.org.
Don't hide field from superclass.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2bb24df8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2bb24df8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2bb24df8

Branch: refs/heads/LOG4J2-608
Commit: 2bb24df8351f7ab341b36a5e072638d7df2b8b9a
Parents: 877490b
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:44:27 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:44:27 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/LoggerBufferedReaderTest.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2bb24df8/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
index d6b6782..5765d4e 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderTest.java
@@ -24,18 +24,18 @@ import java.io.Reader;
 import org.junit.Test;
 
 public class LoggerBufferedReaderTest extends LoggerReaderTest {
-    private BufferedReader reader;
+    private BufferedReader bufferedReader;
     
     @Override
     protected Reader createReader() {
-        return this.reader = new LoggerBufferedReader(this.wrapped, getLogger(), LEVEL);
+        return this.bufferedReader = new LoggerBufferedReader(this.wrapped, getLogger(), LEVEL);
     }
 
     @Test
     public void testReadLine() throws Exception {
-        assertEquals("first line", FIRST, this.reader.readLine());
+        assertEquals("first line", FIRST, this.bufferedReader.readLine());
         assertMessages(FIRST);
-        assertEquals("second line", LAST, this.reader.readLine());
+        assertEquals("second line", LAST, this.bufferedReader.readLine());
         assertMessages(FIRST, LAST);
     }
 }


[19/29] git commit: Do not assign to params for easier debugging.

Posted by ma...@apache.org.
Do not assign to params for easier debugging.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/877490be
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/877490be
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/877490be

Branch: refs/heads/LOG4J2-608
Commit: 877490be9df2ddb3b7c4af96676a13c3818fd101
Parents: 8db7732
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:42:29 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:42:29 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/util/ByteStreamLogger.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/877490be/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
index 27c7319..b7bdf25 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
@@ -120,16 +120,18 @@ public class ByteStreamLogger {
     }
 
     public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
-        if (len >= 0) {
+        int curOff = off;
+        int curLen = len;
+        if (curLen >= 0) {
             synchronized (this.msg) {
-                while (len > this.buf.remaining()) {
+                while (curLen > this.buf.remaining()) {
                     final int remaining = this.buf.remaining();
-                    this.buf.put(b, off, remaining);
-                    len -= remaining;
-                    off += remaining;
+                    this.buf.put(b, curOff, remaining);
+                    curLen -= remaining;
+                    curOff += remaining;
                     extractMessages(fqcn);
                 }
-                this.buf.put(b, off, len);
+                this.buf.put(b, curOff, curLen);
                 extractMessages(fqcn);
             }
         } else {


[27/29] git commit: Remove unused imports.

Posted by ma...@apache.org.
Remove unused imports.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/327d4327
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/327d4327
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/327d4327

Branch: refs/heads/LOG4J2-608
Commit: 327d432787f91c6da83153cc78ac46723ee41f02
Parents: c682ad5
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 20:47:55 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 20:47:55 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/streams/LoggerOutputStream.java   | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/327d4327/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
index 1bfc857..c979432 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
@@ -22,7 +22,6 @@ import java.io.OutputStream;
 import java.nio.charset.Charset;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.ByteStreamLogger;


[10/29] git commit: Sort methods in AB order.

Posted by ma...@apache.org.
Sort methods in AB order.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/30ef44b5
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/30ef44b5
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/30ef44b5

Branch: refs/heads/LOG4J2-608
Commit: 30ef44b5ce4cc30f9c8361411616d2ed7738f2f3
Parents: 3faca25
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:11:40 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:11:40 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/ByteStreamLogger.java | 110 +++++------
 .../logging/log4j/streams/CharStreamLogger.java |  64 +++----
 .../streams/LoggerBufferedInputStream.java      |  48 ++---
 .../log4j/streams/LoggerBufferedReader.java     |  16 +-
 .../log4j/streams/LoggerInputStream.java        |  32 ++--
 .../log4j/streams/LoggerOutputStream.java       |  74 ++++----
 .../log4j/streams/LoggerPrintStream.java        | 184 +++++++++----------
 .../log4j/streams/LoggerPrintWriter.java        | 152 +++++++--------
 .../logging/log4j/streams/LoggerReader.java     |  20 +-
 .../logging/log4j/streams/LoggerStreams.java    | 130 ++++++-------
 .../logging/log4j/streams/LoggerWriter.java     |  40 ++--
 .../log4j/streams/LoggerWriterFilter.java       |  48 ++---
 .../log4j/streams/util/ByteStreamLogger.java    | 110 +++++------
 .../log4j/streams/util/CharStreamLogger.java    |  64 +++----
 .../log4j/streams/AbstractLoggerWriterTest.java |  92 +++++-----
 .../log4j/streams/AbstractStreamTest.java       |  18 +-
 ...LoggerBufferedInputStreamCallerInfoTest.java |  20 +-
 .../LoggerBufferedReaderCallerInfoTest.java     |  20 +-
 .../LoggerInputStreamCallerInfoTest.java        |  12 +-
 .../log4j/streams/LoggerInputStreamTest.java    |  74 ++++----
 .../log4j/streams/LoggerOutputStreamTest.java   |  78 ++++----
 .../LoggerPrintStreamCallerInfoTest.java        |  66 +++----
 .../log4j/streams/LoggerPrintStreamTest.java    |  40 ++--
 .../LoggerPrintWriterCallerInfoTest.java        |  66 +++----
 .../log4j/streams/LoggerPrintWriterTest.java    |  40 ++--
 .../streams/LoggerReaderCallerInfoTest.java     |  12 +-
 .../logging/log4j/streams/LoggerReaderTest.java |  74 ++++----
 .../streams/LoggerStreamsCallerInfoTesting.java |  18 +-
 28 files changed, 861 insertions(+), 861 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
index 80f401c..83e8c3b 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
@@ -28,8 +28,33 @@ import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
 public class ByteStreamLogger {
-    private static final int BUFFER_SIZE = 1024;
+    private class ByteBufferInputStream extends InputStream {
+
+        @Override
+        public int read() throws IOException {
+            buf.flip();
+            int result = -1;
+            if (buf.limit() > 0) {
+                result = buf.get() & 0xFF;
+            }
+            buf.compact();
+            return result;
+        }
+
+        @Override
+        public int read(final byte[] bytes, final int off, final int len) throws IOException {
+            buf.flip();
+            int result = -1;
+            if (buf.limit() > 0) {
+                result = Math.min(len, buf.limit());
+                buf.get(bytes, off, result);
+            }
+            buf.compact();
+            return result;
+        }
+    }
 
+    private static final int BUFFER_SIZE = 1024;
     private final ExtendedLogger logger;
     private final Level level;
     private final Marker marker;
@@ -38,6 +63,7 @@ public class ByteStreamLogger {
     private final char[] msgBuf = new char[BUFFER_SIZE];
     private final StringBuilder msg = new StringBuilder();
     private boolean closed;
+
     private final ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE);
 
     public ByteStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker, final Charset charset) {
@@ -48,35 +74,6 @@ public class ByteStreamLogger {
         reader = new InputStreamReader(in, charset);
     }
 
-    public void put(final String fqcn, final int b) throws IOException {
-        if (b >= 0) {
-            synchronized (msg) {
-                buf.put((byte) (b & 0xFF));
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
-        if (len >= 0) {
-            synchronized (msg) {
-                while (len > buf.remaining()) {
-                    final int remaining = buf.remaining();
-                    buf.put(b, off, remaining);
-                    len -= remaining;
-                    off += remaining;
-                    extractMessages(fqcn);
-                }
-                buf.put(b, off, len);
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
     public void close(final String fqcn) {
         synchronized (msg) {
             closed = true;
@@ -109,42 +106,45 @@ public class ByteStreamLogger {
             read = reader.read(msgBuf);
         }
     }
-    
-    private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
-            log(fqcn);
-        }
-    }
 
     private void log(final String fqcn) {
         // convert to string now so async loggers work
         logger.logIfEnabled(fqcn, level, marker, msg.toString());
         msg.setLength(0);
     }
+    
+    private void logEnd(final String fqcn) {
+        if (msg.length() > 0) {
+            log(fqcn);
+        }
+    }
 
-    private class ByteBufferInputStream extends InputStream {
-
-        @Override
-        public int read() throws IOException {
-            buf.flip();
-            int result = -1;
-            if (buf.limit() > 0) {
-                result = buf.get() & 0xFF;
+    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
+        if (len >= 0) {
+            synchronized (msg) {
+                while (len > buf.remaining()) {
+                    final int remaining = buf.remaining();
+                    buf.put(b, off, remaining);
+                    len -= remaining;
+                    off += remaining;
+                    extractMessages(fqcn);
+                }
+                buf.put(b, off, len);
+                extractMessages(fqcn);
             }
-            buf.compact();
-            return result;
+        } else {
+            logEnd(fqcn);
         }
+    }
 
-        @Override
-        public int read(final byte[] bytes, final int off, final int len) throws IOException {
-            buf.flip();
-            int result = -1;
-            if (buf.limit() > 0) {
-                result = Math.min(len, buf.limit());
-                buf.get(bytes, off, result);
+    public void put(final String fqcn, final int b) throws IOException {
+        if (b >= 0) {
+            synchronized (msg) {
+                buf.put((byte) (b & 0xFF));
+                extractMessages(fqcn);
             }
-            buf.compact();
-            return result;
+        } else {
+            logEnd(fqcn);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
index 589bfaf..d141752 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
@@ -36,27 +36,25 @@ public class CharStreamLogger {
         this.marker = marker;
     }
 
-    public void put(final String fqcn, final int c) {
-        if (c >= 0) {
-            synchronized (msg) {
-                if (closed) {
-                    return;
-                }
-                switch (c) {
-                case '\n':
-                    log(fqcn);
-                    break;
-                case '\r':
-                    break;
-                default:
-                    msg.append((char) c);
-                }
-            }
-        } else {
+    public void close(final String fqcn) {
+        synchronized (msg) {
+            closed = true;
             logEnd(fqcn);
         }
     }
 
+    private void log(final String fqcn) {
+        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
+                                                         // work
+        msg.setLength(0);
+    }
+
+    private void logEnd(final String fqcn) {
+        if (msg.length() > 0) {
+            log(fqcn);
+        }
+    }
+
     public void put(final String fqcn, final char[] cbuf, final int off, final int len) {
         put(fqcn, CharBuffer.wrap(cbuf), off, len);
     }
@@ -89,22 +87,24 @@ public class CharStreamLogger {
         }
     }
 
-    public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
+    public void put(final String fqcn, final int c) {
+        if (c >= 0) {
+            synchronized (msg) {
+                if (closed) {
+                    return;
+                }
+                switch (c) {
+                case '\n':
+                    log(fqcn);
+                    break;
+                case '\r':
+                    break;
+                default:
+                    msg.append((char) c);
+                }
+            }
+        } else {
             logEnd(fqcn);
         }
     }
-
-    private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
-            log(fqcn);
-        }
-    }
-
-    private void log(final String fqcn) {
-        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
-                                                         // work
-        msg.setLength(0);
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
index c60ee1e..26f59ff 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
@@ -30,52 +30,52 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 public class LoggerBufferedInputStream extends BufferedInputStream {
     private static final String FQCN = LoggerBufferedInputStream.class.getName();
 
-    public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level) {
-        this(in, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerInputStream(in, charset, logger, fqcn, level, marker));
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level) {
-        this(in, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerInputStream(in, charset, logger, fqcn, level, marker), sz);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level, final Marker marker) {
-        this(in, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final Logger logger, final Level level) {
+        this(in, charset, sz, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level, final Marker marker) {
-        this(in, charset, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final Logger logger, final Level level, final Marker marker) {
+        this(in, charset, sz, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int sz, final Logger logger, final Level level) {
-        this(in, sz, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level) {
+        this(in, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final Logger logger, final Level level) {
-        this(in, charset, sz, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level, final Marker marker) {
+        this(in, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int sz, final Logger logger, final Level level, final Marker marker) {
-        this(in, sz, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        this(in, Charset.defaultCharset(), logger, fqcn, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final Logger logger, final Level level, final Marker marker) {
-        this(in, charset, sz, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        this(in, Charset.defaultCharset(), sz, logger, fqcn, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        this(in, Charset.defaultCharset(), logger, fqcn, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final int sz, final Logger logger, final Level level) {
+        this(in, sz, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerInputStream(in, charset, logger, fqcn, level, marker));
+    public LoggerBufferedInputStream(final InputStream in, final int sz, final Logger logger, final Level level, final Marker marker) {
+        this(in, sz, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        this(in, Charset.defaultCharset(), sz, logger, fqcn, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level) {
+        this(in, (ExtendedLogger) logger, FQCN, level, null);
     }
     
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerInputStream(in, charset, logger, fqcn, level, marker), sz);
+    public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level, final Marker marker) {
+        this(in, (ExtendedLogger) logger, FQCN, level, marker);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
index 16d998c..74651a2 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
@@ -30,12 +30,12 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 public class LoggerBufferedReader extends BufferedReader {
     private static final String FQCN = LoggerBufferedReader.class.getName();
 
-    public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level) {
-        this(reader, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedReader(final Reader reader, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerReader(reader, logger, FQCN, level, marker));
     }
 
-    public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level, final Marker marker) {
-        this(reader, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedReader(final Reader reader, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerReader(reader, logger, FQCN, level, marker), sz);
     }
 
     public LoggerBufferedReader(final Reader reader, final int sz, final Logger logger, final Level level) {
@@ -46,12 +46,12 @@ public class LoggerBufferedReader extends BufferedReader {
         this(reader, sz, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerBufferedReader(final Reader reader, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerReader(reader, logger, FQCN, level, marker));
+    public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level) {
+        this(reader, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedReader(final Reader reader, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerReader(reader, logger, FQCN, level, marker), sz);
+    public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level, final Marker marker) {
+        this(reader, (ExtendedLogger) logger, FQCN, level, marker);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
index f36dab6..57a59bd 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
@@ -38,26 +38,32 @@ public class LoggerInputStream extends FilterInputStream {
     private final String fqcn;
     private final ByteStreamLogger logger;
 
-    public LoggerInputStream(final InputStream in, final Logger logger, final Level level) {
-        this(in, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(in);
+        this.logger = new ByteStreamLogger(logger, level, marker, charset);
+        this.fqcn = fqcn;
     }
 
     public LoggerInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level) {
         this(in, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerInputStream(final InputStream in, final Logger logger, final Level level, final Marker marker) {
-        this(in, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
-    }
-
     public LoggerInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level, final Marker marker) {
         this(in, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(in);
-        this.logger = new ByteStreamLogger(logger, level, marker, charset);
-        this.fqcn = fqcn;
+    public LoggerInputStream(final InputStream in, final Logger logger, final Level level) {
+        this(in, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    }
+
+    public LoggerInputStream(final InputStream in, final Logger logger, final Level level, final Marker marker) {
+        this(in, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
+    }
+
+    @Override
+    public void close() throws IOException {
+        logger.close(fqcn);
+        super.close();
     }
 
     @Override
@@ -80,12 +86,6 @@ public class LoggerInputStream extends FilterInputStream {
     }
 
     @Override
-    public void close() throws IOException {
-        logger.close(fqcn);
-        super.close();
-    }
-
-    @Override
     public String toString() {
         return LoggerInputStream.class.getSimpleName() + "{stream=" + in + '}';
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
index 609fad2..4b11415 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
@@ -41,86 +41,86 @@ public class LoggerOutputStream extends OutputStream {
     private final ByteStreamLogger logger;
     private final String fqcn;
 
-    public LoggerOutputStream(final Logger logger, final Level level) {
-        this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
-    }
-
     public LoggerOutputStream(final Charset charset, final Logger logger, final Level level) {
         this(null, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final Logger logger, final Level level, final Marker marker) {
-        this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
-    }
-
     public LoggerOutputStream(final Charset charset, final Logger logger, final Level level, final Marker marker) {
         this(null, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Logger logger, final Level level) {
-        this(out, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerOutputStream(final Logger logger, final Level level) {
+        this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level) {
-        this(out, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerOutputStream(final Logger logger, final Level level, final Marker marker) {
+        this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Logger logger, final Level level, final Marker marker) {
-        this(out, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level,
+            final Marker marker) {
+        this.out = out;
+        this.logger = new ByteStreamLogger(logger, level, marker, charset);
+        this.fqcn = fqcn;
+    }
+
+    public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level) {
+        this(out, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
     public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level, final Marker marker) {
         this(out, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level,
-            final Marker marker) {
-        this.out = out;
-        this.logger = new ByteStreamLogger(logger, level, marker, charset);
-        this.fqcn = fqcn;
+    public LoggerOutputStream(final OutputStream out, final Logger logger, final Level level) {
+        this(out, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, null);
+    }
+
+    public LoggerOutputStream(final OutputStream out, final Logger logger, final Level level, final Marker marker) {
+        this(out, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
     }
 
     @Override
-    public void write(final int b) throws IOException {
+    public void close() throws IOException {
         if (out != null) {
-            out.write(b);
+            out.close();
         }
-        logger.put(fqcn, (byte) (b & 0xFF));
+        logger.close(fqcn);
     }
 
     @Override
-    public void write(final byte[] b) throws IOException {
+    public void flush() throws IOException {
         if (out != null) {
-            out.write(b);
+            out.flush();
         }
-        logger.put(fqcn, b, 0, b.length);
     }
 
     @Override
-    public void write(final byte[] b, final int off, final int len) throws IOException {
-        if (out != null) {
-            out.write(b, off, len);
-        }
-        logger.put(fqcn, b, off, len);
+    public String toString() {
+        return LoggerOutputStream.class.getSimpleName() + "{stream=" + out + '}';
     }
 
     @Override
-    public void flush() throws IOException {
+    public void write(final byte[] b) throws IOException {
         if (out != null) {
-            out.flush();
+            out.write(b);
         }
+        logger.put(fqcn, b, 0, b.length);
     }
 
     @Override
-    public void close() throws IOException {
+    public void write(final byte[] b, final int off, final int len) throws IOException {
         if (out != null) {
-            out.close();
+            out.write(b, off, len);
         }
-        logger.close(fqcn);
+        logger.put(fqcn, b, off, len);
     }
 
     @Override
-    public String toString() {
-        return LoggerOutputStream.class.getSimpleName() + "{stream=" + out + '}';
+    public void write(final int b) throws IOException {
+        if (out != null) {
+            out.write(b);
+        }
+        logger.put(fqcn, (byte) (b & 0xFF));
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
index 5829a8d..fe171b1 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
@@ -39,84 +39,87 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 public class LoggerPrintStream extends PrintStream {
     private static final String FQCN = LoggerPrintStream.class.getName();
 
-    public LoggerPrintStream(final Logger logger, final Level level) {
-        this(null, false, (ExtendedLogger) logger, FQCN, level, null);
-    }
-
     public LoggerPrintStream(final Charset charset, final Logger logger, final Level level) throws UnsupportedEncodingException {
         this(null, false, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final Logger logger, final Level level, final Marker marker) {
-        this(null, false, (ExtendedLogger) logger, FQCN, level, marker);
-    }
-
     public LoggerPrintStream(final Charset charset, final Logger logger, final Level level, final Marker marker) throws UnsupportedEncodingException {
         this(null, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Logger logger, final Level level) {
-        this(out, false, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final Logger logger, final Level level) {
+        this(null, false, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level) throws UnsupportedEncodingException {
-        this(out, false, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final Logger logger, final Level level, final Marker marker) {
+        this(null, false, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Logger logger, final Level level, final Marker marker) {
-        this(out, false, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final ExtendedLogger logger, final String fqcn,
+            final Level level, final Marker marker) throws UnsupportedEncodingException {
+        super(new LoggerOutputStream(out, charset, logger, fqcn, level, marker), autoFlush, charset.name());
     }
 
-    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level, final Marker marker)
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final Logger logger, final Level level)
             throws UnsupportedEncodingException {
-        this(out, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
+        this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level) {
-        this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final Logger logger, final Level level, final Marker marker)
+            throws UnsupportedEncodingException {
+        this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final Logger logger, final Level level)
-            throws UnsupportedEncodingException {
-        this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerOutputStream(out, Charset.defaultCharset(), logger, fqcn, level, marker), autoFlush);
+    }
+
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level) {
+        this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, null);
     }
 
     public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level, final Marker marker) {
         this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final Logger logger, final Level level, final Marker marker)
+    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level) throws UnsupportedEncodingException {
+        this(out, false, charset, (ExtendedLogger) logger, FQCN, level, null);
+    }
+
+    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level, final Marker marker)
             throws UnsupportedEncodingException {
-        this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, marker);
+        this(out, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerOutputStream(out, Charset.defaultCharset(), logger, fqcn, level, marker), autoFlush);
+    public LoggerPrintStream(final OutputStream out, final Logger logger, final Level level) {
+        this(out, false, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final ExtendedLogger logger, final String fqcn,
-            final Level level, final Marker marker) throws UnsupportedEncodingException {
-        super(new LoggerOutputStream(out, charset, logger, fqcn, level, marker), autoFlush, charset.name());
+    public LoggerPrintStream(final OutputStream out, final Logger logger, final Level level, final Marker marker) {
+        this(out, false, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
     @Override
-    public void write(final int b) {
-        super.write(b);
+    public LoggerPrintStream append(final char c) {
+        super.append(c);
+        return this;
     }
 
     @Override
-    public void write(final byte[] b) throws IOException {
-        super.write(b);
+    public LoggerPrintStream append(final CharSequence csq) {
+        super.append(csq);
+        return this;
     }
 
     @Override
-    public void write(final byte[] b, final int off, final int len) {
-        super.write(b, off, len);
+    public LoggerPrintStream append(final CharSequence csq, final int start, final int end) {
+        super.append(csq, start, end);
+        return this;
     }
 
     @Override
-    public void flush() {
-        super.flush();
+    public boolean checkError() {
+        return super.checkError();
     }
 
     @Override
@@ -125,6 +128,23 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
+    public void flush() {
+        super.flush();
+    }
+
+    @Override
+    public LoggerPrintStream format(final Locale l, final String format, final Object... args) {
+        super.format(l, format, args);
+        return this;
+    }
+
+    @Override
+    public LoggerPrintStream format(final String format, final Object... args) {
+        super.format(format, args);
+        return this;
+    }
+
+    @Override
     public void print(final boolean b) {
         super.print(b);
     }
@@ -135,13 +155,13 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
-    public void print(final int i) {
-        super.print(i);
+    public void print(final char[] s) {
+        super.print(s);
     }
 
     @Override
-    public void print(final long l) {
-        super.print(l);
+    public void print(final double d) {
+        super.print(d);
     }
 
     @Override
@@ -150,13 +170,18 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
-    public void print(final double d) {
-        super.print(d);
+    public void print(final int i) {
+        super.print(i);
     }
 
     @Override
-    public void print(final char[] s) {
-        super.print(s);
+    public void print(final long l) {
+        super.print(l);
+    }
+
+    @Override
+    public void print(final Object obj) {
+        super.print(obj);
     }
 
     @Override
@@ -165,8 +190,15 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
-    public void print(final Object obj) {
-        super.print(obj);
+    public LoggerPrintStream printf(final Locale l, final String format, final Object... args) {
+        super.printf(l, format, args);
+        return this;
+    }
+
+    @Override
+    public LoggerPrintStream printf(final String format, final Object... args) {
+        super.printf(format, args);
+        return this;
     }
 
     @Override
@@ -185,12 +217,12 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
-    public void println(final int x) {
+    public void println(final char[] x) {
         super.println(x);
     }
 
     @Override
-    public void println(final long x) {
+    public void println(final double x) {
         super.println(x);
     }
 
@@ -200,17 +232,12 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
-    public void println(final double x) {
-        super.println(x);
-    }
-
-    @Override
-    public void println(final char[] x) {
+    public void println(final int x) {
         super.println(x);
     }
 
     @Override
-    public void println(final String x) {
+    public void println(final long x) {
         super.println(x);
     }
 
@@ -220,54 +247,27 @@ public class LoggerPrintStream extends PrintStream {
     }
 
     @Override
-    public LoggerPrintStream printf(final String format, final Object... args) {
-        super.printf(format, args);
-        return this;
-    }
-
-    @Override
-    public LoggerPrintStream printf(final Locale l, final String format, final Object... args) {
-        super.printf(l, format, args);
-        return this;
-    }
-
-    @Override
-    public LoggerPrintStream append(final char c) {
-        super.append(c);
-        return this;
-    }
-
-    @Override
-    public LoggerPrintStream append(final CharSequence csq) {
-        super.append(csq);
-        return this;
-    }
-
-    @Override
-    public LoggerPrintStream append(final CharSequence csq, final int start, final int end) {
-        super.append(csq, start, end);
-        return this;
+    public void println(final String x) {
+        super.println(x);
     }
 
     @Override
-    public LoggerPrintStream format(final String format, final Object... args) {
-        super.format(format, args);
-        return this;
+    public String toString() {
+        return LoggerPrintStream.class.getSimpleName() + "{stream=" + out + '}';
     }
 
     @Override
-    public LoggerPrintStream format(final Locale l, final String format, final Object... args) {
-        super.format(l, format, args);
-        return this;
+    public void write(final byte[] b) throws IOException {
+        super.write(b);
     }
 
     @Override
-    public boolean checkError() {
-        return super.checkError();
+    public void write(final byte[] b, final int off, final int len) {
+        super.write(b, off, len);
     }
 
     @Override
-    public String toString() {
-        return LoggerPrintStream.class.getSimpleName() + "{stream=" + out + '}';
+    public void write(final int b) {
+        super.write(b);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index 531a08b..e896329 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -34,6 +34,12 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 public class LoggerPrintWriter extends PrintWriter {
     private static final String FQCN = LoggerPrintWriter.class.getName();
 
+    @SuppressWarnings("resource")
+    public LoggerPrintWriter(final ExtendedLogger logger, final boolean autoFlush, final String fqcn,
+            final Level level, final Marker marker) {
+        super(new LoggerWriter(logger, fqcn, level, marker), autoFlush);
+    }
+
     public LoggerPrintWriter(final Logger logger, final Level level) {
         this((ExtendedLogger) logger, false, FQCN, level, null);
     }
@@ -42,12 +48,10 @@ public class LoggerPrintWriter extends PrintWriter {
         this((ExtendedLogger) logger, false, FQCN, level, marker);
     }
 
-    public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level) {
-        this(writer, false, (ExtendedLogger) logger, FQCN, level, null);
-    }
-
-    public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level, final Marker marker) {
-        this(writer, false, (ExtendedLogger) logger, FQCN, level, marker);
+    @SuppressWarnings("resource")
+    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final String fqcn,
+            final Level level, final Marker marker) {
+        super(new LoggerWriterFilter(writer, logger, fqcn, level, marker), autoFlush);
     }
 
     public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final Logger logger, final Level level) {
@@ -58,41 +62,40 @@ public class LoggerPrintWriter extends PrintWriter {
         this(writer, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    @SuppressWarnings("resource")
-    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final String fqcn,
-            final Level level, final Marker marker) {
-        super(new LoggerWriterFilter(writer, logger, fqcn, level, marker), autoFlush);
+    public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level) {
+        this(writer, false, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    @SuppressWarnings("resource")
-    public LoggerPrintWriter(final ExtendedLogger logger, final boolean autoFlush, final String fqcn,
-            final Level level, final Marker marker) {
-        super(new LoggerWriter(logger, fqcn, level, marker), autoFlush);
+    public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level, final Marker marker) {
+        this(writer, false, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
     @Override
-    public void write(final int c) {
-        super.write(c);
+    public LoggerPrintWriter append(final char c) {
+        super.append(c);
+        return this;
     }
     
     @Override
-    public void write(final char[] buf) {
-        super.write(buf);
+    public LoggerPrintWriter append(final CharSequence csq) {
+        super.append(csq);
+        return this;
     }
     
     @Override
-    public void write(final char[] buf, final int off, final int len) {
-        super.write(buf, off, len);
+    public LoggerPrintWriter append(final CharSequence csq, final int start, final int end) {
+        super.append(csq, start, end);
+        return this;
     }
     
     @Override
-    public void write(final String s) {
-        super.write(s);
+    public boolean checkError() {
+        return super.checkError();
     }
     
     @Override
-    public void write(final String s, final int off, final int len) {
-        super.write(s, off, len);
+    public void close() {
+        super.close();
     }
 
     @Override
@@ -101,8 +104,15 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public void close() {
-        super.close();
+    public LoggerPrintWriter format(final Locale l, final String format, final Object... args) {
+        super.format(l, format, args);
+        return this;
+    }
+
+    @Override
+    public LoggerPrintWriter format(final String format, final Object... args) {
+        super.format(format, args);
+        return this;
     }
 
     @Override
@@ -116,13 +126,13 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public void print(final int i) {
-        super.print(i);
+    public void print(final char[] s) {
+        super.print(s);
     }
 
     @Override
-    public void print(final long l) {
-        super.print(l);
+    public void print(final double d) {
+        super.print(d);
     }
 
     @Override
@@ -131,13 +141,18 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public void print(final double d) {
-        super.print(d);
+    public void print(final int i) {
+        super.print(i);
     }
 
     @Override
-    public void print(final char[] s) {
-        super.print(s);
+    public void print(final long l) {
+        super.print(l);
+    }
+
+    @Override
+    public void print(final Object obj) {
+        super.print(obj);
     }
 
     @Override
@@ -146,8 +161,15 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public void print(final Object obj) {
-        super.print(obj);
+    public LoggerPrintWriter printf(final Locale l, final String format, final Object... args) {
+        super.printf(l, format, args);
+        return this;
+    }
+
+    @Override
+    public LoggerPrintWriter printf(final String format, final Object... args) {
+        super.printf(format, args);
+        return this;
     }
 
     @Override
@@ -166,12 +188,12 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public void println(final int x) {
+    public void println(final char[] x) {
         super.println(x);
     }
 
     @Override
-    public void println(final long x) {
+    public void println(final double x) {
         super.println(x);
     }
 
@@ -181,17 +203,12 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public void println(final double x) {
-        super.println(x);
-    }
-
-    @Override
-    public void println(final char[] x) {
+    public void println(final int x) {
         super.println(x);
     }
 
     @Override
-    public void println(final String x) {
+    public void println(final long x) {
         super.println(x);
     }
 
@@ -201,54 +218,37 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @Override
-    public LoggerPrintWriter printf(final String format, final Object... args) {
-        super.printf(format, args);
-        return this;
-    }
-
-    @Override
-    public LoggerPrintWriter printf(final Locale l, final String format, final Object... args) {
-        super.printf(l, format, args);
-        return this;
-    }
-
-    @Override
-    public LoggerPrintWriter append(final char c) {
-        super.append(c);
-        return this;
+    public void println(final String x) {
+        super.println(x);
     }
 
     @Override
-    public LoggerPrintWriter append(final CharSequence csq) {
-        super.append(csq);
-        return this;
+    public String toString() {
+        return LoggerPrintWriter.class.getSimpleName() + "{stream=" + out + '}';
     }
 
     @Override
-    public LoggerPrintWriter append(final CharSequence csq, final int start, final int end) {
-        super.append(csq, start, end);
-        return this;
+    public void write(final char[] buf) {
+        super.write(buf);
     }
 
     @Override
-    public LoggerPrintWriter format(final String format, final Object... args) {
-        super.format(format, args);
-        return this;
+    public void write(final char[] buf, final int off, final int len) {
+        super.write(buf, off, len);
     }
 
     @Override
-    public LoggerPrintWriter format(final Locale l, final String format, final Object... args) {
-        super.format(l, format, args);
-        return this;
+    public void write(final int c) {
+        super.write(c);
     }
     
     @Override
-    public boolean checkError() {
-        return super.checkError();
+    public void write(final String s) {
+        super.write(s);
     }
 
     @Override
-    public String toString() {
-        return LoggerPrintWriter.class.getSimpleName() + "{stream=" + out + '}';
+    public void write(final String s, final int off, final int len) {
+        super.write(s, off, len);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
index 8432982..39fa6fe 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
@@ -39,6 +39,12 @@ public class LoggerReader extends FilterReader {
     private final CharStreamLogger logger;
     private final String fqcn;
 
+    public LoggerReader(final Reader reader, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(reader);
+        this.logger = new CharStreamLogger(logger, level, marker);
+        this.fqcn = fqcn;
+    }
+
     public LoggerReader(final Reader reader, final Logger logger, final Level level) {
         this(reader, (ExtendedLogger) logger, FQCN, level, null);
     }
@@ -47,10 +53,10 @@ public class LoggerReader extends FilterReader {
         this(reader, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerReader(final Reader reader, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(reader);
-        this.logger = new CharStreamLogger(logger, level, marker);
-        this.fqcn = fqcn;
+    @Override
+    public void close() throws IOException {
+        super.close();
+        logger.close(fqcn);
     }
 
     @Override
@@ -84,12 +90,6 @@ public class LoggerReader extends FilterReader {
     }
 
     @Override
-    public void close() throws IOException {
-        super.close();
-        logger.close(fqcn);
-    }
-
-    @Override
     public String toString() {
         return LoggerReader.class.getSimpleName() + "{stream=" + in + '}';
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index 887cc4d..82bc946 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -30,24 +30,47 @@ import org.apache.logging.log4j.Marker;
 
 public class LoggerStreams {
 
-    public static Builder trace(final Logger logger) {
-        return new Builder(logger, Level.TRACE, null);
-    }
+    public static class BufferedBuilder {
+        private final Logger logger;
+        private final Level level;
+        private final Marker marker;
+        private final int size;
 
-    public static Builder debug(final Logger logger) {
-        return new Builder(logger, Level.DEBUG, null);
-    }
+        BufferedBuilder(final Logger logger, final Level level, final Marker marker, final int size) {
+            this.logger = logger;
+            this.level = level;
+            this.marker = marker;
+            this.size = size;
+        }
 
-    public static Builder info(final Logger logger) {
-        return new Builder(logger, Level.INFO, null);
-    }
+        public LoggerBufferedInputStream create(final InputStream in) {
+            if (size > 0) {
+                return new LoggerBufferedInputStream(in, size, logger, level, marker);
+            }
+            return new LoggerBufferedInputStream(in, logger, level, marker);
+        }
 
-    public static Builder warn(final Logger logger) {
-        return new Builder(logger, Level.WARN, null);
-    }
+        public LoggerBufferedInputStream create(final InputStream in, final Charset charset) {
+            if (size > 0) {
+                return new LoggerBufferedInputStream(in, charset, size, logger, level, marker);
+            }
+            return new LoggerBufferedInputStream(in, charset, logger, level, marker);
+        }
 
-    public static Builder error(final Logger logger) {
-        return new Builder(logger, Level.ERROR, null);
+        public LoggerBufferedReader create(final Reader reader) {
+            if (size > 0) {
+                return new LoggerBufferedReader(reader, size, logger, level, marker);
+            }
+            return new LoggerBufferedReader(reader, logger, level, marker);
+        }
+
+        public BufferedBuilder marker(final Marker marker) {
+            return new BufferedBuilder(logger, level, marker, size);
+        }
+
+        public BufferedBuilder size(final int size) {
+            return new BufferedBuilder(logger, level, marker, size);
+        }
     }
 
     public static class Builder {
@@ -61,14 +84,6 @@ public class LoggerStreams {
             this.marker = marker;
         }
 
-        public Builder marker(final Marker marker) {
-            return new Builder(logger, level, marker);
-        }
-
-        public PrintingBuilder printing() {
-            return new PrintingBuilder(logger, level, marker, false);
-        }
-
         public BufferedBuilder buffered() {
             return new BufferedBuilder(logger, level, marker, 0);
         }
@@ -76,6 +91,14 @@ public class LoggerStreams {
         public LoggerWriterFilter create(final Writer writer) {
             return new LoggerWriterFilter(writer, logger, level, marker);
         }
+
+        public Builder marker(final Marker marker) {
+            return new Builder(logger, level, marker);
+        }
+
+        public PrintingBuilder printing() {
+            return new PrintingBuilder(logger, level, marker, false);
+        }
     }
 
     public static class PrintingBuilder {
@@ -91,10 +114,6 @@ public class LoggerStreams {
             this.autoFlush = autoFlush;
         }
 
-        public PrintingBuilder marker(final Marker marker) {
-            return new PrintingBuilder(logger, level, marker, autoFlush);
-        }
-
         public PrintingBuilder autoFlush() {
             return autoFlush(true);
         }
@@ -103,10 +122,6 @@ public class LoggerStreams {
             return new PrintingBuilder(logger, level, marker, autoFlush);
         }
 
-        public LoggerPrintWriter create(final Writer writer) {
-            return new LoggerPrintWriter(writer, autoFlush, logger, level, marker);
-        }
-
         public LoggerPrintStream create(final OutputStream out) {
             return new LoggerPrintStream(out, autoFlush, logger, level, marker);
         }
@@ -119,48 +134,33 @@ public class LoggerStreams {
                 throw new IllegalArgumentException("Invalid charset", e);
             }
         }
-    }
-
-    public static class BufferedBuilder {
-        private final Logger logger;
-        private final Level level;
-        private final Marker marker;
-        private final int size;
 
-        BufferedBuilder(final Logger logger, final Level level, final Marker marker, final int size) {
-            this.logger = logger;
-            this.level = level;
-            this.marker = marker;
-            this.size = size;
+        public LoggerPrintWriter create(final Writer writer) {
+            return new LoggerPrintWriter(writer, autoFlush, logger, level, marker);
         }
 
-        public BufferedBuilder marker(final Marker marker) {
-            return new BufferedBuilder(logger, level, marker, size);
+        public PrintingBuilder marker(final Marker marker) {
+            return new PrintingBuilder(logger, level, marker, autoFlush);
         }
+    }
 
-        public BufferedBuilder size(final int size) {
-            return new BufferedBuilder(logger, level, marker, size);
-        }
+    public static Builder debug(final Logger logger) {
+        return new Builder(logger, Level.DEBUG, null);
+    }
 
-        public LoggerBufferedReader create(final Reader reader) {
-            if (size > 0) {
-                return new LoggerBufferedReader(reader, size, logger, level, marker);
-            }
-            return new LoggerBufferedReader(reader, logger, level, marker);
-        }
+    public static Builder error(final Logger logger) {
+        return new Builder(logger, Level.ERROR, null);
+    }
 
-        public LoggerBufferedInputStream create(final InputStream in) {
-            if (size > 0) {
-                return new LoggerBufferedInputStream(in, size, logger, level, marker);
-            }
-            return new LoggerBufferedInputStream(in, logger, level, marker);
-        }
+    public static Builder info(final Logger logger) {
+        return new Builder(logger, Level.INFO, null);
+    }
 
-        public LoggerBufferedInputStream create(final InputStream in, final Charset charset) {
-            if (size > 0) {
-                return new LoggerBufferedInputStream(in, charset, size, logger, level, marker);
-            }
-            return new LoggerBufferedInputStream(in, charset, logger, level, marker);
-        }
+    public static Builder trace(final Logger logger) {
+        return new Builder(logger, Level.TRACE, null);
+    }
+
+    public static Builder warn(final Logger logger) {
+        return new Builder(logger, Level.WARN, null);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index 8233d64..63cbfe8 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -37,22 +37,30 @@ public class LoggerWriter extends Writer {
     private final CharStreamLogger logger;
     private final String fqcn;
 
-    public LoggerWriter(final Logger logger, final Level level, final Marker marker) {
-        this((ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerWriter(final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        this.logger = new CharStreamLogger(logger, level, marker);
+        this.fqcn = fqcn;
     }
 
     public LoggerWriter(final Logger logger, final Level level) {
         this((ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerWriter(final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        this.logger = new CharStreamLogger(logger, level, marker);
-        this.fqcn = fqcn;
+    public LoggerWriter(final Logger logger, final Level level, final Marker marker) {
+        this((ExtendedLogger) logger, FQCN, level, marker);
     }
 
     @Override
-    public void write(final int c) throws IOException {
-        logger.put(fqcn, (char) c);
+    public void close() throws IOException {
+        logger.close(fqcn);
+    }
+
+    @Override
+    public void flush() throws IOException {
+    }
+
+    public String toString() {
+        return this.getClass().getSimpleName() + "[fqcn=" + fqcn + ", logger=" + logger + "]";
     }
 
     @Override
@@ -66,6 +74,11 @@ public class LoggerWriter extends Writer {
     }
 
     @Override
+    public void write(final int c) throws IOException {
+        logger.put(fqcn, (char) c);
+    }
+
+    @Override
     public void write(final String str) throws IOException {
         logger.put(fqcn, str, 0, str.length());
     }
@@ -74,17 +87,4 @@ public class LoggerWriter extends Writer {
     public void write(final String str, final int off, final int len) throws IOException {
         logger.put(fqcn, str, off, len);
     }
-
-    @Override
-    public void flush() throws IOException {
-    }
-
-    @Override
-    public void close() throws IOException {
-        logger.close(fqcn);
-    }
-
-    public String toString() {
-        return this.getClass().getSimpleName() + "[fqcn=" + fqcn + ", logger=" + logger + "]";
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
index 9b7e3a0..f583e5b 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
@@ -38,6 +38,13 @@ public class LoggerWriterFilter extends FilterWriter {
     private final CharStreamLogger logger;
     private final String fqcn;
 
+    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final String fqcn, final Level level,
+            final Marker marker) {
+        super(out);
+        this.logger = new CharStreamLogger(logger, level, marker);
+        this.fqcn = fqcn;
+    }
+
     public LoggerWriterFilter(final Writer out, final Logger logger, final Level level) {
         this(out, (ExtendedLogger) logger, FQCN, level, null);
     }
@@ -46,17 +53,20 @@ public class LoggerWriterFilter extends FilterWriter {
         this(out, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final String fqcn, final Level level,
-            final Marker marker) {
-        super(out);
-        this.logger = new CharStreamLogger(logger, level, marker);
-        this.fqcn = fqcn;
+    @Override
+    public void close() throws IOException {
+        out.close();
+        logger.close(fqcn);
     }
 
     @Override
-    public void write(final int c) throws IOException {
-        out.write(c);
-        logger.put(fqcn, (char) c);
+    public void flush() throws IOException {
+        out.flush();
+    }
+
+    @Override
+    public String toString() {
+        return LoggerWriterFilter.class.getSimpleName() + "{writer=" + out + '}';
     }
 
     @Override
@@ -72,6 +82,12 @@ public class LoggerWriterFilter extends FilterWriter {
     }
 
     @Override
+    public void write(final int c) throws IOException {
+        out.write(c);
+        logger.put(fqcn, (char) c);
+    }
+
+    @Override
     public void write(final String str) throws IOException {
         out.write(str);
         logger.put(fqcn, str, 0, str.length());
@@ -82,20 +98,4 @@ public class LoggerWriterFilter extends FilterWriter {
         out.write(str, off, len);
         logger.put(fqcn, str, off, len);
     }
-
-    @Override
-    public void flush() throws IOException {
-        out.flush();
-    }
-
-    @Override
-    public void close() throws IOException {
-        out.close();
-        logger.close(fqcn);
-    }
-
-    @Override
-    public String toString() {
-        return LoggerWriterFilter.class.getSimpleName() + "{writer=" + out + '}';
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
index 06a7cde..655497b 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
@@ -28,8 +28,33 @@ import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
 public class ByteStreamLogger {
-    private static final int BUFFER_SIZE = 1024;
+    private class ByteBufferInputStream extends InputStream {
+
+        @Override
+        public int read() throws IOException {
+            buf.flip();
+            int result = -1;
+            if (buf.limit() > 0) {
+                result = buf.get() & 0xFF;
+            }
+            buf.compact();
+            return result;
+        }
+
+        @Override
+        public int read(final byte[] bytes, final int off, final int len) throws IOException {
+            buf.flip();
+            int result = -1;
+            if (buf.limit() > 0) {
+                result = Math.min(len, buf.limit());
+                buf.get(bytes, off, result);
+            }
+            buf.compact();
+            return result;
+        }
+    }
 
+    private static final int BUFFER_SIZE = 1024;
     private final ExtendedLogger logger;
     private final Level level;
     private final Marker marker;
@@ -38,6 +63,7 @@ public class ByteStreamLogger {
     private final char[] msgBuf = new char[BUFFER_SIZE];
     private final StringBuilder msg = new StringBuilder();
     private boolean closed;
+
     private final ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE);
 
     public ByteStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker, final Charset charset) {
@@ -48,35 +74,6 @@ public class ByteStreamLogger {
         reader = new InputStreamReader(in, charset);
     }
 
-    public void put(final String fqcn, final int b) throws IOException {
-        if (b >= 0) {
-            synchronized (msg) {
-                buf.put((byte) (b & 0xFF));
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
-        if (len >= 0) {
-            synchronized (msg) {
-                while (len > buf.remaining()) {
-                    final int remaining = buf.remaining();
-                    buf.put(b, off, remaining);
-                    len -= remaining;
-                    off += remaining;
-                    extractMessages(fqcn);
-                }
-                buf.put(b, off, len);
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
     public void close(final String fqcn) {
         synchronized (msg) {
             closed = true;
@@ -109,42 +106,45 @@ public class ByteStreamLogger {
             read = reader.read(msgBuf);
         }
     }
-    
-    private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
-            log(fqcn);
-        }
-    }
 
     private void log(final String fqcn) {
         // convert to string now so async loggers work
         logger.logIfEnabled(fqcn, level, marker, msg.toString());
         msg.setLength(0);
     }
+    
+    private void logEnd(final String fqcn) {
+        if (msg.length() > 0) {
+            log(fqcn);
+        }
+    }
 
-    private class ByteBufferInputStream extends InputStream {
-
-        @Override
-        public int read() throws IOException {
-            buf.flip();
-            int result = -1;
-            if (buf.limit() > 0) {
-                result = buf.get() & 0xFF;
+    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
+        if (len >= 0) {
+            synchronized (msg) {
+                while (len > buf.remaining()) {
+                    final int remaining = buf.remaining();
+                    buf.put(b, off, remaining);
+                    len -= remaining;
+                    off += remaining;
+                    extractMessages(fqcn);
+                }
+                buf.put(b, off, len);
+                extractMessages(fqcn);
             }
-            buf.compact();
-            return result;
+        } else {
+            logEnd(fqcn);
         }
+    }
 
-        @Override
-        public int read(final byte[] bytes, final int off, final int len) throws IOException {
-            buf.flip();
-            int result = -1;
-            if (buf.limit() > 0) {
-                result = Math.min(len, buf.limit());
-                buf.get(bytes, off, result);
+    public void put(final String fqcn, final int b) throws IOException {
+        if (b >= 0) {
+            synchronized (msg) {
+                buf.put((byte) (b & 0xFF));
+                extractMessages(fqcn);
             }
-            buf.compact();
-            return result;
+        } else {
+            logEnd(fqcn);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
index 3eb0851..71b63ce 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
@@ -36,27 +36,25 @@ public class CharStreamLogger {
         this.marker = marker;
     }
 
-    public void put(final String fqcn, final int c) {
-        if (c >= 0) {
-            synchronized (msg) {
-                if (closed) {
-                    return;
-                }
-                switch (c) {
-                case '\n':
-                    log(fqcn);
-                    break;
-                case '\r':
-                    break;
-                default:
-                    msg.append((char) c);
-                }
-            }
-        } else {
+    public void close(final String fqcn) {
+        synchronized (msg) {
+            closed = true;
             logEnd(fqcn);
         }
     }
 
+    private void log(final String fqcn) {
+        // convert to string now so async loggers work
+        logger.logIfEnabled(fqcn, level, marker, msg.toString());
+        msg.setLength(0);
+    }
+
+    private void logEnd(final String fqcn) {
+        if (msg.length() > 0) {
+            log(fqcn);
+        }
+    }
+
     public void put(final String fqcn, final char[] cbuf, final int off, final int len) {
         put(fqcn, CharBuffer.wrap(cbuf), off, len);
     }
@@ -89,22 +87,24 @@ public class CharStreamLogger {
         }
     }
 
-    public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
+    public void put(final String fqcn, final int c) {
+        if (c >= 0) {
+            synchronized (msg) {
+                if (closed) {
+                    return;
+                }
+                switch (c) {
+                case '\n':
+                    log(fqcn);
+                    break;
+                case '\r':
+                    break;
+                default:
+                    msg.append((char) c);
+                }
+            }
+        } else {
             logEnd(fqcn);
         }
     }
-
-    private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
-            log(fqcn);
-        }
-    }
-
-    private void log(final String fqcn) {
-        // convert to string now so async loggers work
-        logger.logIfEnabled(fqcn, level, marker, msg.toString());
-        msg.setLength(0);
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
index 5d727cb..f62360f 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
@@ -44,33 +44,39 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
     protected abstract Writer createWriterWrapper();
 
     @Test
-    public void testWrite_CharArray() throws Exception {
-        final char[] chars = FIRST.toCharArray();
-        writer.write(chars);
+    public void testClose_HasRemainingData() throws IOException {
+        writer.write(FIRST);
         assertMessages();
-        writer.write('\n');
+        writer.close();
         assertMessages(FIRST);
         if (wrapped != null) {
-            assertEquals(FIRST + '\n', wrapped.toString());
+            assertEquals(FIRST, wrapped.toString());
         }
     }
 
     @Test
-    public void testWrite_CharArray_Offset_Length() throws Exception {
-        final char[] chars = FIRST.toCharArray();
-        final int middle = chars.length / 2;
-        final int length = chars.length - middle;
-        final String right = new String(chars, middle, length);
-        writer.write(chars, middle, length);
+    public void testClose_NoRemainingData() throws IOException {
+        writer.close();
         assertMessages();
-        writer.write('\n');
-        assertMessages(right);
         if (wrapped != null) {
-            assertEquals(FIRST.substring(middle, FIRST.length()) + '\n', wrapped.toString());
+            assertEquals("", wrapped.toString());
         }
     }
 
     @Test
+    public void testFlush() throws IOException {
+        final OutputStream out = EasyMock.createMock(OutputStream.class);
+        out.flush(); // expect the flush to come through to the mocked OutputStream
+        out.close();
+        replay(out);
+
+        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
+        los.flush();
+        los.close();
+        verify(out);
+    }
+
+    @Test
     public void testWrite_Character() throws Exception {
         for (final char c : FIRST.toCharArray()) {
             writer.write(c);
@@ -84,55 +90,49 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
     }
 
     @Test
-    public void testWrite_IgnoresWindowsNewline() throws IOException {
-        writer.write(FIRST + "\r\n");
-        writer.write(LAST);
-        writer.close();
-        assertMessages(FIRST, LAST);
+    public void testWrite_CharArray() throws Exception {
+        final char[] chars = FIRST.toCharArray();
+        writer.write(chars);
+        assertMessages();
+        writer.write('\n');
+        assertMessages(FIRST);
         if (wrapped != null) {
-            assertEquals(FIRST + "\r\n" + LAST, wrapped.toString());
+            assertEquals(FIRST + '\n', wrapped.toString());
         }
     }
 
     @Test
-    public void testWrite_MultipleLines() throws IOException {
-        writer.write(FIRST + '\n' + LAST + '\n');
-        assertMessages(FIRST, LAST);
+    public void testWrite_CharArray_Offset_Length() throws Exception {
+        final char[] chars = FIRST.toCharArray();
+        final int middle = chars.length / 2;
+        final int length = chars.length - middle;
+        final String right = new String(chars, middle, length);
+        writer.write(chars, middle, length);
+        assertMessages();
+        writer.write('\n');
+        assertMessages(right);
         if (wrapped != null) {
-            assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
+            assertEquals(FIRST.substring(middle, FIRST.length()) + '\n', wrapped.toString());
         }
     }
 
     @Test
-    public void testFlush() throws IOException {
-        final OutputStream out = EasyMock.createMock(OutputStream.class);
-        out.flush(); // expect the flush to come through to the mocked OutputStream
-        out.close();
-        replay(out);
-
-        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
-        los.flush();
-        los.close();
-        verify(out);
-    }
-
-    @Test
-    public void testClose_NoRemainingData() throws IOException {
+    public void testWrite_IgnoresWindowsNewline() throws IOException {
+        writer.write(FIRST + "\r\n");
+        writer.write(LAST);
         writer.close();
-        assertMessages();
+        assertMessages(FIRST, LAST);
         if (wrapped != null) {
-            assertEquals("", wrapped.toString());
+            assertEquals(FIRST + "\r\n" + LAST, wrapped.toString());
         }
     }
 
     @Test
-    public void testClose_HasRemainingData() throws IOException {
-        writer.write(FIRST);
-        assertMessages();
-        writer.close();
-        assertMessages(FIRST);
+    public void testWrite_MultipleLines() throws IOException {
+        writer.write(FIRST + '\n' + LAST + '\n');
+        assertMessages(FIRST, LAST);
         if (wrapped != null) {
-            assertEquals(FIRST, wrapped.toString());
+            assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
index 6422309..17d5c72 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
@@ -31,23 +31,18 @@ import org.junit.Before;
 import org.junit.ClassRule;
 
 public abstract class AbstractStreamTest {
+    protected static Logger getLogger() {
+        return ctx.getLogger("UnitTestLogger");
+    }
     protected final static String NEWLINE = System.getProperty("line.separator");
     protected final static Level LEVEL = Level.ERROR;
     protected final static String FIRST = "first";
+
     protected final static String LAST = "last";
 
     @ClassRule
     public static InitialLoggerContext ctx = new InitialLoggerContext("log4j2-streams-unit-test.xml");
 
-    protected static Logger getLogger() {
-        return ctx.getLogger("UnitTestLogger");
-    }
-
-    @Before
-    public void clearAppender() {
-        ((ListAppender) ctx.getAppender("UnitTest")).clear();
-    }
-
     protected void assertMessages(final String... messages) {
         final List<String> actualMsgs = ((ListAppender) ctx.getAppender("UnitTest")).getMessages();
         assertEquals("Unexpected number of results.", messages.length, actualMsgs.size());
@@ -56,4 +51,9 @@ public abstract class AbstractStreamTest {
             assertThat(actualMsgs.get(i), startsWith(start));
         }
     }
+
+    @Before
+    public void clearAppender() {
+        ((ListAppender) ctx.getAppender("UnitTest")).clear();
+    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
index b8206c8..07df463 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedInputStreamCallerInfoTest.java
@@ -26,10 +26,12 @@ public class LoggerBufferedInputStreamCallerInfoTest extends LoggerStreamsCaller
 
     private LoggerBufferedInputStream logIn;
     
-    @Before
-    public void setupStreams() {
-        final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
-        logIn = new LoggerBufferedInputStream(srcInputStream, getLogger(), LEVEL);
+    @Test
+    public void close() throws Exception {
+        logIn.read();
+        assertMessages("before close", 3, "close");
+        logIn.close();
+        assertMessages("after close", 4, "close");
     }
     
     @Test
@@ -56,11 +58,9 @@ public class LoggerBufferedInputStreamCallerInfoTest extends LoggerStreamsCaller
         logIn.close();
     }
 
-    @Test
-    public void close() throws Exception {
-        logIn.read();
-        assertMessages("before close", 3, "close");
-        logIn.close();
-        assertMessages("after close", 4, "close");
+    @Before
+    public void setupStreams() {
+        final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
+        logIn = new LoggerBufferedInputStream(srcInputStream, getLogger(), LEVEL);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
index 3d3b927..44850dd 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerBufferedReaderCallerInfoTest.java
@@ -28,10 +28,12 @@ public class LoggerBufferedReaderCallerInfoTest extends LoggerStreamsCallerInfoT
 
     LoggerBufferedReader logReader;
     
-    @Before
-    public void setupReader() {
-        final Reader srcReader = new StringReader("a\nb\nc\nd");
-        logReader = new LoggerBufferedReader(srcReader, getLogger(), Level.WARN);
+    @Test
+    public void close() throws Exception {
+        logReader.readLine();
+        assertMessages("before close", 3, "close");
+        logReader.close();
+        assertMessages("after close", 4, "close");
     }
 
     @Test
@@ -74,11 +76,9 @@ public class LoggerBufferedReaderCallerInfoTest extends LoggerStreamsCallerInfoT
         logReader.close();
     }
 
-    @Test
-    public void close() throws Exception {
-        logReader.readLine();
-        assertMessages("before close", 3, "close");
-        logReader.close();
-        assertMessages("after close", 4, "close");
+    @Before
+    public void setupReader() {
+        final Reader srcReader = new StringReader("a\nb\nc\nd");
+        logReader = new LoggerBufferedReader(srcReader, getLogger(), Level.WARN);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
index 5942217..1c68548 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamCallerInfoTest.java
@@ -27,12 +27,6 @@ public class LoggerInputStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
 
     private LoggerInputStream logIn;
     
-    @Before
-    public void setupStreams() {
-        final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
-        logIn = new LoggerInputStream(srcInputStream, getLogger(), Level.WARN);
-    }
-    
     @Test
     public void read() throws Exception {
         logIn.read();
@@ -51,4 +45,10 @@ public class LoggerInputStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
         logIn.close();
         assertMessages("after close size", 4, "read");
     }
+    
+    @Before
+    public void setupStreams() {
+        final InputStream srcInputStream = new ByteArrayInputStream("a\nb\nc\nd".getBytes());
+        logIn = new LoggerInputStream(srcInputStream, getLogger(), Level.WARN);
+    }
 }


[23/29] git commit: Remove duplicate classes.

Posted by ma...@apache.org.
Remove duplicate classes.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e298c1b2
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e298c1b2
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e298c1b2

Branch: refs/heads/LOG4J2-608
Commit: e298c1b254e09d84f9966f6f5f466a8186b8dc0c
Parents: ab7a7a2
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:53:06 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:53:06 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/ByteStreamLogger.java | 152 -------------------
 .../logging/log4j/streams/CharStreamLogger.java | 110 --------------
 2 files changed, 262 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e298c1b2/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
deleted file mode 100644
index 6efa138..0000000
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.streams;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.spi.ExtendedLogger;
-
-public class ByteStreamLogger {
-    private class ByteBufferInputStream extends InputStream {
-
-        @Override
-        public int read() throws IOException {
-            ByteStreamLogger.this.buf.flip();
-            int result = -1;
-            if (ByteStreamLogger.this.buf.limit() > 0) {
-                result = ByteStreamLogger.this.buf.get() & 0xFF;
-            }
-            ByteStreamLogger.this.buf.compact();
-            return result;
-        }
-
-        @Override
-        public int read(final byte[] bytes, final int off, final int len) throws IOException {
-            ByteStreamLogger.this.buf.flip();
-            int result = -1;
-            if (ByteStreamLogger.this.buf.limit() > 0) {
-                result = Math.min(len, ByteStreamLogger.this.buf.limit());
-                ByteStreamLogger.this.buf.get(bytes, off, result);
-            }
-            ByteStreamLogger.this.buf.compact();
-            return result;
-        }
-    }
-
-    private static final int BUFFER_SIZE = 1024;
-    private final ExtendedLogger logger;
-    private final Level level;
-    private final Marker marker;
-    private final ByteBufferInputStream in;
-    private final InputStreamReader reader;
-    private final char[] msgBuf = new char[BUFFER_SIZE];
-    private final StringBuilder msg = new StringBuilder();
-    private boolean closed;
-
-    private final ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE);
-
-    public ByteStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker, final Charset charset) {
-        this.logger = logger;
-        this.level = level;
-        this.marker = marker;
-        this.in = new ByteBufferInputStream();
-        this.reader = new InputStreamReader(this.in, charset);
-    }
-
-    public void close(final String fqcn) {
-        synchronized (this.msg) {
-            this.closed = true;
-            logEnd(fqcn);
-//            in.close();
-        }
-    }
-
-    private void extractMessages(final String fqcn) throws IOException {
-        if (this.closed) {
-            return;
-        }
-        int read = this.reader.read(this.msgBuf);
-        while (read > 0) {
-            int off = 0;
-            for (int pos = 0; pos < read; pos++) {
-                switch (this.msgBuf[pos]) {
-                case '\r':
-                    this.msg.append(this.msgBuf, off, pos - off);
-                    off = pos + 1;
-                    break;
-                case '\n':
-                    this.msg.append(this.msgBuf, off, pos - off);
-                    off = pos + 1;
-                    log(fqcn);
-                    break;
-                }
-            }
-            this.msg.append(this.msgBuf, off, read - off);
-            read = this.reader.read(this.msgBuf);
-        }
-    }
-
-    private void log(final String fqcn) {
-        // convert to string now so async loggers work
-        this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString());
-        this.msg.setLength(0);
-    }
-    
-    private void logEnd(final String fqcn) {
-        if (this.msg.length() > 0) {
-            log(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final byte[] b, final int off, final int len) throws IOException {
-        int curLen = len;
-        int curOff = off;
-        if (curLen >= 0) {
-            synchronized (this.msg) {
-                while (curLen > this.buf.remaining()) {
-                    final int remaining = this.buf.remaining();
-                    this.buf.put(b, curOff, remaining);
-                    curLen -= remaining;
-                    curOff += remaining;
-                    extractMessages(fqcn);
-                }
-                this.buf.put(b, curOff, curLen);
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final int b) throws IOException {
-        if (b >= 0) {
-            synchronized (this.msg) {
-                this.buf.put((byte) (b & 0xFF));
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e298c1b2/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
deleted file mode 100644
index b46cf85..0000000
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/CharStreamLogger.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.streams;
-
-import java.nio.CharBuffer;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.spi.ExtendedLogger;
-
-public class CharStreamLogger {
-    private final ExtendedLogger logger;
-    private final Level level;
-    private final Marker marker;
-    private final StringBuilder msg = new StringBuilder();
-    private boolean closed = false;
-
-    public CharStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker) {
-        this.logger = logger;
-        this.level = level;
-        this.marker = marker;
-    }
-
-    public void close(final String fqcn) {
-        synchronized (this.msg) {
-            this.closed = true;
-            logEnd(fqcn);
-        }
-    }
-
-    private void log(final String fqcn) {
-        this.logger.logIfEnabled(fqcn, this.level, this.marker, this.msg.toString()); // convert to string now so async loggers
-                                                         // work
-        this.msg.setLength(0);
-    }
-
-    private void logEnd(final String fqcn) {
-        if (this.msg.length() > 0) {
-            log(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final char[] cbuf, final int off, final int len) {
-        put(fqcn, CharBuffer.wrap(cbuf), off, len);
-    }
-
-    public void put(final String fqcn, final CharSequence str, final int off, final int len) {
-        if (len >= 0) {
-            synchronized (this.msg) {
-                if (this.closed) {
-                    return;
-                }
-                int start = off;
-                final int end = off + len;
-                for (int pos = off; pos < end; pos++) {
-                    final char c = str.charAt(pos);
-                    switch (c) {
-                    case '\r':
-                    case '\n':
-                        this.msg.append(str, start, pos);
-                        start = pos + 1;
-                        if (c == '\n') {
-                            log(fqcn);
-                        }
-                        break;
-                    }
-                }
-                this.msg.append(str, start, end);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final int c) {
-        if (c >= 0) {
-            synchronized (this.msg) {
-                if (this.closed) {
-                    return;
-                }
-                switch (c) {
-                case '\n':
-                    log(fqcn);
-                    break;
-                case '\r':
-                    break;
-                default:
-                    this.msg.append((char) c);
-                }
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-}


[06/29] git commit: We use util and as package name for Util gardgets, so use util instead of helpers.

Posted by ma...@apache.org.
We use util and as package name for Util gardgets, so use util instead
of helpers.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a497e405
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a497e405
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a497e405

Branch: refs/heads/LOG4J2-608
Commit: a497e405f0b85c7e952d835293f2043d0b95d5c9
Parents: 3fd8320
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 09:25:48 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 09:25:48 2014 -0400

----------------------------------------------------------------------
 .../log4j/streams/LoggerInputStream.java        |   2 +-
 .../log4j/streams/LoggerOutputStream.java       |   2 +-
 .../logging/log4j/streams/LoggerReader.java     |   2 +-
 .../logging/log4j/streams/LoggerWriter.java     |   2 +-
 .../log4j/streams/helpers/ByteStreamLogger.java | 150 -------------------
 .../log4j/streams/helpers/CharStreamLogger.java | 110 --------------
 .../log4j/streams/util/ByteStreamLogger.java    | 150 +++++++++++++++++++
 .../log4j/streams/util/CharStreamLogger.java    | 110 ++++++++++++++
 8 files changed, 264 insertions(+), 264 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
index 61ed149..f36dab6 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
-import org.apache.logging.log4j.streams.helpers.ByteStreamLogger;
+import org.apache.logging.log4j.streams.util.ByteStreamLogger;
 
 /**
  * Input stream that logs each line read to a pre-defined level. Can also be configured with a

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
index f6a504b..609fad2 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
-import org.apache.logging.log4j.streams.helpers.ByteStreamLogger;
+import org.apache.logging.log4j.streams.util.ByteStreamLogger;
 
 /**
  * Output stream that logs each line written to a pre-defined level. Can also be configured with a

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
index 74e7c63..8432982 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
-import org.apache.logging.log4j.streams.helpers.CharStreamLogger;
+import org.apache.logging.log4j.streams.util.CharStreamLogger;
 
 /**
  * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker.

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index 98e6f8e..30915d6 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
-import org.apache.logging.log4j.streams.helpers.CharStreamLogger;
+import org.apache.logging.log4j.streams.util.CharStreamLogger;
 
 /**
  * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker.

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
deleted file mode 100644
index 1157ea5..0000000
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/ByteStreamLogger.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.streams.helpers;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.spi.ExtendedLogger;
-
-public class ByteStreamLogger {
-    private static final int BUFFER_SIZE = 1024;
-
-    private final ExtendedLogger logger;
-    private final Level level;
-    private final Marker marker;
-    private final ByteBufferInputStream in;
-    private final InputStreamReader reader;
-    private final char[] msgBuf = new char[BUFFER_SIZE];
-    private final StringBuilder msg = new StringBuilder();
-    private boolean closed;
-    private final ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE);
-
-    public ByteStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker, final Charset charset) {
-        this.logger = logger;
-        this.level = level;
-        this.marker = marker;
-        in = new ByteBufferInputStream();
-        reader = new InputStreamReader(in, charset);
-    }
-
-    public void put(final String fqcn, final int b) throws IOException {
-        if (b >= 0) {
-            synchronized (msg) {
-                buf.put((byte) (b & 0xFF));
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
-        if (len >= 0) {
-            synchronized (msg) {
-                while (len > buf.remaining()) {
-                    final int remaining = buf.remaining();
-                    buf.put(b, off, remaining);
-                    len -= remaining;
-                    off += remaining;
-                    extractMessages(fqcn);
-                }
-                buf.put(b, off, len);
-                extractMessages(fqcn);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
-            logEnd(fqcn);
-//            in.close();
-        }
-    }
-
-    private void extractMessages(final String fqcn) throws IOException {
-        if (closed) {
-            return;
-        }
-        int read = reader.read(msgBuf);
-        while (read > 0) {
-            int off = 0;
-            for (int pos = 0; pos < read; pos++) {
-                switch (msgBuf[pos]) {
-                case '\r':
-                    msg.append(msgBuf, off, pos - off);
-                    off = pos + 1;
-                    break;
-                case '\n':
-                    msg.append(msgBuf, off, pos - off);
-                    off = pos + 1;
-                    log(fqcn);
-                    break;
-                }
-            }
-            msg.append(msgBuf, off, read - off);
-            read = reader.read(msgBuf);
-        }
-    }
-    
-    private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
-            log(fqcn);
-        }
-    }
-
-    private void log(final String fqcn) {
-        // convert to string now so async loggers work
-        logger.logIfEnabled(fqcn, level, marker, msg.toString());
-        msg.setLength(0);
-    }
-
-    private class ByteBufferInputStream extends InputStream {
-
-        @Override
-        public int read() throws IOException {
-            buf.flip();
-            int result = -1;
-            if (buf.limit() > 0) {
-                result = buf.get() & 0xFF;
-            }
-            buf.compact();
-            return result;
-        }
-
-        @Override
-        public int read(final byte[] bytes, final int off, final int len) throws IOException {
-            buf.flip();
-            int result = -1;
-            if (buf.limit() > 0) {
-                result = Math.min(len, buf.limit());
-                buf.get(bytes, off, result);
-            }
-            buf.compact();
-            return result;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/CharStreamLogger.java
deleted file mode 100644
index 1282e84..0000000
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/helpers/CharStreamLogger.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.streams.helpers;
-
-import java.nio.CharBuffer;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.spi.ExtendedLogger;
-
-public class CharStreamLogger {
-    private final ExtendedLogger logger;
-    private final Level level;
-    private final Marker marker;
-    private final StringBuilder msg = new StringBuilder();
-    private boolean closed = false;
-
-    public CharStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker) {
-        this.logger = logger;
-        this.level = level;
-        this.marker = marker;
-    }
-
-    public void put(final String fqcn, final int c) {
-        if (c >= 0) {
-            synchronized (msg) {
-                if (closed) {
-                    return;
-                }
-                switch (c) {
-                case '\n':
-                    log(fqcn);
-                    break;
-                case '\r':
-                    break;
-                default:
-                    msg.append((char) c);
-                }
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void put(final String fqcn, final char[] cbuf, final int off, final int len) {
-        put(fqcn, CharBuffer.wrap(cbuf), off, len);
-    }
-
-    public void put(final String fqcn, final CharSequence str, final int off, final int len) {
-        if (len >= 0) {
-            synchronized (msg) {
-                if (closed) {
-                    return;
-                }
-                int start = off;
-                final int end = off + len;
-                for (int pos = off; pos < end; pos++) {
-                    final char c = str.charAt(pos);
-                    switch (c) {
-                    case '\r':
-                    case '\n':
-                        msg.append(str, start, pos);
-                        start = pos + 1;
-                        if (c == '\n') {
-                            log(fqcn);
-                        }
-                        break;
-                    }
-                }
-                msg.append(str, start, end);
-            }
-        } else {
-            logEnd(fqcn);
-        }
-    }
-
-    public void close(final String fqcn) {
-        synchronized (msg) {
-            closed = true;
-            logEnd(fqcn);
-        }
-    }
-
-    private void logEnd(final String fqcn) {
-        if (msg.length() > 0) {
-            log(fqcn);
-        }
-    }
-
-    private void log(final String fqcn) {
-        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
-                                                         // work
-        msg.setLength(0);
-    }
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
new file mode 100644
index 0000000..06a7cde
--- /dev/null
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/ByteStreamLogger.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.logging.log4j.streams.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.spi.ExtendedLogger;
+
+public class ByteStreamLogger {
+    private static final int BUFFER_SIZE = 1024;
+
+    private final ExtendedLogger logger;
+    private final Level level;
+    private final Marker marker;
+    private final ByteBufferInputStream in;
+    private final InputStreamReader reader;
+    private final char[] msgBuf = new char[BUFFER_SIZE];
+    private final StringBuilder msg = new StringBuilder();
+    private boolean closed;
+    private final ByteBuffer buf = ByteBuffer.allocate(BUFFER_SIZE);
+
+    public ByteStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker, final Charset charset) {
+        this.logger = logger;
+        this.level = level;
+        this.marker = marker;
+        in = new ByteBufferInputStream();
+        reader = new InputStreamReader(in, charset);
+    }
+
+    public void put(final String fqcn, final int b) throws IOException {
+        if (b >= 0) {
+            synchronized (msg) {
+                buf.put((byte) (b & 0xFF));
+                extractMessages(fqcn);
+            }
+        } else {
+            logEnd(fqcn);
+        }
+    }
+
+    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
+        if (len >= 0) {
+            synchronized (msg) {
+                while (len > buf.remaining()) {
+                    final int remaining = buf.remaining();
+                    buf.put(b, off, remaining);
+                    len -= remaining;
+                    off += remaining;
+                    extractMessages(fqcn);
+                }
+                buf.put(b, off, len);
+                extractMessages(fqcn);
+            }
+        } else {
+            logEnd(fqcn);
+        }
+    }
+
+    public void close(final String fqcn) {
+        synchronized (msg) {
+            closed = true;
+            logEnd(fqcn);
+//            in.close();
+        }
+    }
+
+    private void extractMessages(final String fqcn) throws IOException {
+        if (closed) {
+            return;
+        }
+        int read = reader.read(msgBuf);
+        while (read > 0) {
+            int off = 0;
+            for (int pos = 0; pos < read; pos++) {
+                switch (msgBuf[pos]) {
+                case '\r':
+                    msg.append(msgBuf, off, pos - off);
+                    off = pos + 1;
+                    break;
+                case '\n':
+                    msg.append(msgBuf, off, pos - off);
+                    off = pos + 1;
+                    log(fqcn);
+                    break;
+                }
+            }
+            msg.append(msgBuf, off, read - off);
+            read = reader.read(msgBuf);
+        }
+    }
+    
+    private void logEnd(final String fqcn) {
+        if (msg.length() > 0) {
+            log(fqcn);
+        }
+    }
+
+    private void log(final String fqcn) {
+        // convert to string now so async loggers work
+        logger.logIfEnabled(fqcn, level, marker, msg.toString());
+        msg.setLength(0);
+    }
+
+    private class ByteBufferInputStream extends InputStream {
+
+        @Override
+        public int read() throws IOException {
+            buf.flip();
+            int result = -1;
+            if (buf.limit() > 0) {
+                result = buf.get() & 0xFF;
+            }
+            buf.compact();
+            return result;
+        }
+
+        @Override
+        public int read(final byte[] bytes, final int off, final int len) throws IOException {
+            buf.flip();
+            int result = -1;
+            if (buf.limit() > 0) {
+                result = Math.min(len, buf.limit());
+                buf.get(bytes, off, result);
+            }
+            buf.compact();
+            return result;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a497e405/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
new file mode 100644
index 0000000..4e136ed
--- /dev/null
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.logging.log4j.streams.util;
+
+import java.nio.CharBuffer;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.spi.ExtendedLogger;
+
+public class CharStreamLogger {
+    private final ExtendedLogger logger;
+    private final Level level;
+    private final Marker marker;
+    private final StringBuilder msg = new StringBuilder();
+    private boolean closed = false;
+
+    public CharStreamLogger(final ExtendedLogger logger, final Level level, final Marker marker) {
+        this.logger = logger;
+        this.level = level;
+        this.marker = marker;
+    }
+
+    public void put(final String fqcn, final int c) {
+        if (c >= 0) {
+            synchronized (msg) {
+                if (closed) {
+                    return;
+                }
+                switch (c) {
+                case '\n':
+                    log(fqcn);
+                    break;
+                case '\r':
+                    break;
+                default:
+                    msg.append((char) c);
+                }
+            }
+        } else {
+            logEnd(fqcn);
+        }
+    }
+
+    public void put(final String fqcn, final char[] cbuf, final int off, final int len) {
+        put(fqcn, CharBuffer.wrap(cbuf), off, len);
+    }
+
+    public void put(final String fqcn, final CharSequence str, final int off, final int len) {
+        if (len >= 0) {
+            synchronized (msg) {
+                if (closed) {
+                    return;
+                }
+                int start = off;
+                final int end = off + len;
+                for (int pos = off; pos < end; pos++) {
+                    final char c = str.charAt(pos);
+                    switch (c) {
+                    case '\r':
+                    case '\n':
+                        msg.append(str, start, pos);
+                        start = pos + 1;
+                        if (c == '\n') {
+                            log(fqcn);
+                        }
+                        break;
+                    }
+                }
+                msg.append(str, start, end);
+            }
+        } else {
+            logEnd(fqcn);
+        }
+    }
+
+    public void close(final String fqcn) {
+        synchronized (msg) {
+            closed = true;
+            logEnd(fqcn);
+        }
+    }
+
+    private void logEnd(final String fqcn) {
+        if (msg.length() > 0) {
+            log(fqcn);
+        }
+    }
+
+    private void log(final String fqcn) {
+        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
+                                                         // work
+        msg.setLength(0);
+    }
+}


[21/29] git commit: Add // comment to empty block.

Posted by ma...@apache.org.
Add // comment to empty block.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/51b2ef49
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/51b2ef49
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/51b2ef49

Branch: refs/heads/LOG4J2-608
Commit: 51b2ef49da0e1098ab3b4e5d9af8e863bc5e4a8a
Parents: 2bb24df
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:45:30 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:45:30 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/logging/log4j/streams/LoggerWriter.java    | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/51b2ef49/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index 291ee45..22bac96 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -56,6 +56,7 @@ public class LoggerWriter extends Writer {
 
     @Override
     public void flush() throws IOException {
+        // do nothing
     }
 
     @Override


[22/29] git commit: All missing API for fatal level.

Posted by ma...@apache.org.
All missing API for fatal level.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ab7a7a2e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ab7a7a2e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ab7a7a2e

Branch: refs/heads/LOG4J2-608
Commit: ab7a7a2e60331f3fa4d25db02657a6e231f367cb
Parents: 51b2ef4
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:46:38 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:46:38 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/streams/LoggerStreams.java     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ab7a7a2e/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index 4aa6483..2adbeb8 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -152,6 +152,10 @@ public class LoggerStreams {
         return new Builder(logger, Level.ERROR, null);
     }
 
+    public static Builder fatal(final Logger logger) {
+        return new Builder(logger, Level.FATAL, null);
+    }
+
     public static Builder info(final Logger logger) {
         return new Builder(logger, Level.INFO, null);
     }


[12/29] git commit: Forgot to add ASL header.

Posted by ma...@apache.org.
Forgot to add ASL header.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/9383cbc2
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/9383cbc2
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/9383cbc2

Branch: refs/heads/LOG4J2-608
Commit: 9383cbc22d07b3a358e9afb82103c6f91676354d
Parents: 1a62458
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:14:09 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:14:09 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/LoggerWriterTest.java     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9383cbc2/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
index 5cdcb81..42a474b 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.logging.log4j.streams;
 
 import java.io.StringWriter;


[24/29] git commit: Better param name: sz -> size.

Posted by ma...@apache.org.
Better param name: sz -> size.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c3718e49
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c3718e49
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c3718e49

Branch: refs/heads/LOG4J2-608
Commit: c3718e49938287c49ddaac6c84b5fe3df0c00fb2
Parents: e298c1b
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 11:00:59 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 11:00:59 2014 -0400

----------------------------------------------------------------------
 .../log4j/streams/LoggerBufferedInputStream.java        | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c3718e49/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
index 74b8918..041fdac 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
@@ -34,16 +34,16 @@ public class LoggerBufferedInputStream extends BufferedInputStream {
         super(new LoggerInputStream(in, charset, logger, fqcn, level, marker));
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerInputStream(in, charset, logger, fqcn, level, marker), sz);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerInputStream(in, charset, logger, fqcn, level, marker), size);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final Logger logger, final Level level) {
-        this(in, charset, sz, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final Logger logger, final Level level) {
+        this(in, charset, size, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int sz, final Logger logger, final Level level, final Marker marker) {
-        this(in, charset, sz, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final Charset charset, final int size, final Logger logger, final Level level, final Marker marker) {
+        this(in, charset, size, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
     public LoggerBufferedInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level) {


[04/29] git commit: Add final modifier to private fields Add final modifier to method parameters Add final modifier to local variables

Posted by ma...@apache.org.
Add final modifier to private fields
Add final modifier to method parameters
Add final modifier to local variables

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f25c5392
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f25c5392
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f25c5392

Branch: refs/heads/LOG4J2-608
Commit: f25c5392ab61534203826329d3cdf02a1143ae19
Parents: c6f88b6
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 09:22:23 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 09:22:23 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/streams/LoggerStreams.java   | 2 +-
 .../apache/logging/log4j/streams/LoggerInputStreamTest.java    | 4 ++--
 .../apache/logging/log4j/streams/LoggerOutputStreamTest.java   | 6 +++---
 .../apache/logging/log4j/streams/LoggerPrintStreamTest.java    | 2 +-
 .../apache/logging/log4j/streams/LoggerPrintWriterTest.java    | 2 +-
 .../org/apache/logging/log4j/streams/LoggerReaderTest.java     | 4 ++--
 .../logging/log4j/streams/LoggerStreamsCallerInfoTesting.java  | 4 ++--
 .../org/apache/logging/log4j/streams/LoggerWriterTest.java     | 6 +++---
 .../java/org/apache/logging/log4j/streams/StreamTesting.java   | 2 +-
 9 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index f74ce7e..1ad59d9 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -114,7 +114,7 @@ public class LoggerStreams {
         public LoggerPrintStream create(final OutputStream out, final Charset charset) {
             try {
                 return new LoggerPrintStream(out, autoFlush, charset, logger, level, marker);
-            } catch (UnsupportedEncodingException e) {
+            } catch (final UnsupportedEncodingException e) {
                 // Should never occur because the constructor must throw this
                 throw new IllegalArgumentException("Invalid charset", e);
             }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
index 919449b..3d11e02 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
@@ -84,7 +84,7 @@ public class LoggerInputStreamTest extends StreamTesting {
     @Test
     public void testRead_IgnoresWindowsNewline() throws IOException {
         final byte[] bytes = new byte[1024];
-        int len = in.read(bytes);
+        final int len = in.read(bytes);
         read.write(bytes, 0, len);
         assertMessages(FIRST);
         assertEquals(FIRST + "\r\n" + LAST, read.toString());
@@ -98,7 +98,7 @@ public class LoggerInputStreamTest extends StreamTesting {
         in = new LoggerInputStream(wrapped, getLogger(), LEVEL);
 
         final byte[] bytes = new byte[1024];
-        int len = in.read(bytes);
+        final int len = in.read(bytes);
         read.write(bytes, 0, len);
         assertMessages(FIRST, LAST);
         assertEquals(FIRST + '\n' + LAST + '\n', read.toString());

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
index 94c4c55..21ebef1 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
@@ -45,7 +45,7 @@ public class LoggerOutputStreamTest extends StreamTesting {
 
     @Test
     public void testWrite_Int() throws Exception {
-        for (byte b : "int".getBytes()) {
+        for (final byte b : "int".getBytes()) {
             out.write(b);
             assertMessages();
         }
@@ -67,8 +67,8 @@ public class LoggerOutputStreamTest extends StreamTesting {
     @Test
     public void testWrite_ByteArray_Offset_Length() throws Exception {
         final byte[] bytes = "byte[]".getBytes();
-        int middle = bytes.length/2;
-        int length = bytes.length - middle;
+        final int middle = bytes.length/2;
+        final int length = bytes.length - middle;
         final String right = new String(bytes, middle, length);
         out.write(bytes, middle, length);
         assertMessages();

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
index 9cae0dc..b793910 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
@@ -42,7 +42,7 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
 
     @Test
     public void testPrint_char() throws Exception {
-        for (char c : FIRST.toCharArray()) {
+        for (final char c : FIRST.toCharArray()) {
             print.print(c);
             assertMessages();
         }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index e8d2996..2e33a37 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -44,7 +44,7 @@ public class LoggerPrintWriterTest extends LoggerWriterTest {
 
     @Test
     public void testPrint_char() throws Exception {
-        for (char c : FIRST.toCharArray()) {
+        for (final char c : FIRST.toCharArray()) {
             print.print(c);
             assertMessages();
         }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
index f94c96c..b41b9c6 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
@@ -94,7 +94,7 @@ public class LoggerReaderTest extends StreamTesting {
     @Test
     public void testRead_IgnoresWindowsNewline() throws IOException {
         final char[] chars = new char[1024];
-        int len = reader.read(chars);
+        final int len = reader.read(chars);
         read.write(chars, 0, len);
         if (!(reader instanceof BufferedReader)) {
             assertMessages(FIRST);
@@ -110,7 +110,7 @@ public class LoggerReaderTest extends StreamTesting {
         reader = createReader();
 
         final char[] chars = new char[1024];
-        int len = reader.read(chars);
+        final int len = reader.read(chars);
         read.write(chars, 0, len);
         assertMessages(FIRST, LAST);
         assertEquals(FIRST + '\n' + LAST + '\n', read.toString());

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
index 430d4b7..5d81380 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
@@ -41,8 +41,8 @@ public class LoggerStreamsCallerInfoTesting {
         ((ListAppender) ctx.getAppender("ClassAndMethod")).clear();
     }
 
-    public void assertMessages(final String msg, int size, String methodName) {
-        ListAppender appender = (ListAppender) ctx.getAppender("ClassAndMethod");
+    public void assertMessages(final String msg, final int size, final String methodName) {
+        final ListAppender appender = (ListAppender) ctx.getAppender("ClassAndMethod");
         assertEquals(msg + ".size", size, appender.getMessages().size());
         for (final String message : appender.getMessages()) {
             assertEquals(msg + " has incorrect caller info", this.getClass().getName() + '.' + methodName, message);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
index b14fdc0..ea188af 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
@@ -56,8 +56,8 @@ public class LoggerWriterTest extends StreamTesting {
     @Test
     public void testWrite_CharArray_Offset_Length() throws Exception {
         final char[] chars = FIRST.toCharArray();
-        int middle = chars.length / 2;
-        int length = chars.length - middle;
+        final int middle = chars.length / 2;
+        final int length = chars.length - middle;
         final String right = new String(chars, middle, length);
         writer.write(chars, middle, length);
         assertMessages();
@@ -68,7 +68,7 @@ public class LoggerWriterTest extends StreamTesting {
 
     @Test
     public void testWrite_Character() throws Exception {
-        for (char c : FIRST.toCharArray()) {
+        for (final char c : FIRST.toCharArray()) {
             writer.write(c);
             assertMessages();
         }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f25c5392/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
index 80adf20..c2d9a61 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
@@ -51,7 +51,7 @@ public class StreamTesting {
     }
 
     protected void assertMessages(final String... messages) {
-        List<String> actualMsgs = ((ListAppender) ctx.getAppender("UnitTest")).getMessages();
+        final List<String> actualMsgs = ((ListAppender) ctx.getAppender("UnitTest")).getMessages();
         assertEquals("Unexpected number of results.", messages.length, actualMsgs.size());
         for (int i = 0; i < messages.length; i++) {
             final String start = LEVEL.name() + ' ' + messages[i];


[11/29] git commit: Add missing '@Override' annotations.

Posted by ma...@apache.org.
Add missing '@Override' annotations.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1a624584
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1a624584
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1a624584

Branch: refs/heads/LOG4J2-608
Commit: 1a62458495e2f30084301413fc03dd085e568206
Parents: 30ef44b
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:12:30 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:12:30 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/logging/log4j/streams/LoggerWriter.java   | 1 +
 .../org/apache/logging/log4j/streams/LoggerPrintWriterTest.java    | 1 +
 .../org/apache/logging/log4j/streams/LoggerWriterFilterTest.java   | 2 ++
 .../java/org/apache/logging/log4j/streams/LoggerWriterTest.java    | 2 ++
 4 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1a624584/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index 63cbfe8..ee10247 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -59,6 +59,7 @@ public class LoggerWriter extends Writer {
     public void flush() throws IOException {
     }
 
+    @Override
     public String toString() {
         return this.getClass().getSimpleName() + "[fqcn=" + fqcn + ", logger=" + logger + "]";
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1a624584/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index 212efd5..7d1fac3 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -28,6 +28,7 @@ import org.junit.Test;
 public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
     private PrintWriter print; 
 
+    @Override
     protected StringWriter createWriter() {
         return new StringWriter();
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1a624584/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
index c3aac1c..0b2af3a 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
@@ -5,10 +5,12 @@ import java.io.Writer;
 
 public class LoggerWriterFilterTest extends AbstractLoggerWriterTest {
 
+    @Override
     protected StringWriter createWriter() {
         return new StringWriter();
     }
 
+    @Override
     protected Writer createWriterWrapper() {
         return new LoggerWriterFilter(wrapped, getLogger(), LEVEL);
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1a624584/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
index b52e468..5cdcb81 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
@@ -5,10 +5,12 @@ import java.io.Writer;
 
 public class LoggerWriterTest extends AbstractLoggerWriterTest {
 
+    @Override
     protected StringWriter createWriter() {
         return null;
     }
 
+    @Override
     protected Writer createWriterWrapper() {
         return new LoggerWriter(getLogger(), LEVEL);
     }


[28/29] git commit: Oops, got the FilterWriter class name backwards.

Posted by ma...@apache.org.
Oops, got the FilterWriter class name backwards.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/9c878544
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/9c878544
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/9c878544

Branch: refs/heads/LOG4J2-608
Commit: 9c878544b754d31b231a44a48fe96bf979d94e6f
Parents: 327d432
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 20:51:28 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 20:51:28 2014 -0400

----------------------------------------------------------------------
 .../log4j/streams/LoggerFilterWriter.java       | 99 ++++++++++++++++++++
 .../log4j/streams/LoggerPrintWriter.java        |  2 +-
 .../logging/log4j/streams/LoggerStreams.java    |  4 +-
 .../log4j/streams/LoggerWriterFilter.java       | 99 --------------------
 .../log4j/streams/LoggerFilterWriterTest.java   | 18 ++++
 .../log4j/streams/LoggerWriterFilterTest.java   | 18 ----
 6 files changed, 120 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9c878544/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerFilterWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerFilterWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerFilterWriter.java
new file mode 100644
index 0000000..2735d89
--- /dev/null
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerFilterWriter.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.logging.log4j.streams;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.spi.ExtendedLogger;
+import org.apache.logging.log4j.streams.util.CharStreamLogger;
+
+/**
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external out.
+ */
+public class LoggerFilterWriter extends FilterWriter {
+    private static final String FQCN = LoggerFilterWriter.class.getName();
+
+    private final CharStreamLogger logger;
+    private final String fqcn;
+
+    public LoggerFilterWriter(final Writer out, final ExtendedLogger logger, final String fqcn, final Level level,
+            final Marker marker) {
+        super(out);
+        this.logger = new CharStreamLogger(logger, level, marker);
+        this.fqcn = fqcn;
+    }
+
+    public LoggerFilterWriter(final Writer out, final ExtendedLogger logger, final Level level) {
+        this(out, logger, FQCN, level, null);
+    }
+
+    public LoggerFilterWriter(final Writer out, final ExtendedLogger logger, final Level level, final Marker marker) {
+        this(out, logger, FQCN, level, marker);
+    }
+
+    @Override
+    public void close() throws IOException {
+        this.out.close();
+        this.logger.close(this.fqcn);
+    }
+
+    @Override
+    public void flush() throws IOException {
+        this.out.flush();
+    }
+
+    @Override
+    public String toString() {
+        return LoggerFilterWriter.class.getSimpleName() + "{writer=" + this.out + '}';
+    }
+
+    @Override
+    public void write(final char[] cbuf) throws IOException {
+        this.out.write(cbuf);
+        this.logger.put(this.fqcn, cbuf, 0, cbuf.length);
+    }
+
+    @Override
+    public void write(final char[] cbuf, final int off, final int len) throws IOException {
+        this.out.write(cbuf, off, len);
+        this.logger.put(this.fqcn, cbuf, off, len);
+    }
+
+    @Override
+    public void write(final int c) throws IOException {
+        this.out.write(c);
+        this.logger.put(this.fqcn, (char) c);
+    }
+
+    @Override
+    public void write(final String str) throws IOException {
+        this.out.write(str);
+        this.logger.put(this.fqcn, str, 0, str.length());
+    }
+
+    @Override
+    public void write(final String str, final int off, final int len) throws IOException {
+        this.out.write(str, off, len);
+        this.logger.put(this.fqcn, str, off, len);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9c878544/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index cb9b350..2a6b02a 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -54,7 +54,7 @@ public class LoggerPrintWriter extends PrintWriter {
     @SuppressWarnings("resource")
     public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger,
             final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerWriterFilter(writer, logger, fqcn, level, marker), autoFlush);
+        super(new LoggerFilterWriter(writer, logger, fqcn, level, marker), autoFlush);
     }
 
     public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final Level level) {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9c878544/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index 3a99c28..bef87b5 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -88,8 +88,8 @@ public class LoggerStreams {
             return new BufferedBuilder(this.logger, this.level, this.marker, 0);
         }
 
-        public LoggerWriterFilter create(final Writer writer) {
-            return new LoggerWriterFilter(writer, this.logger, this.level, this.marker);
+        public LoggerFilterWriter create(final Writer writer) {
+            return new LoggerFilterWriter(writer, this.logger, this.level, this.marker);
         }
 
         public Builder marker(final Marker marker) {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9c878544/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
deleted file mode 100644
index 0ecc719..0000000
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.streams;
-
-import java.io.FilterWriter;
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.spi.ExtendedLogger;
-import org.apache.logging.log4j.streams.util.CharStreamLogger;
-
-/**
- * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
- * that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external out.
- */
-public class LoggerWriterFilter extends FilterWriter {
-    private static final String FQCN = LoggerWriterFilter.class.getName();
-
-    private final CharStreamLogger logger;
-    private final String fqcn;
-
-    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final String fqcn, final Level level,
-            final Marker marker) {
-        super(out);
-        this.logger = new CharStreamLogger(logger, level, marker);
-        this.fqcn = fqcn;
-    }
-
-    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final Level level) {
-        this(out, logger, FQCN, level, null);
-    }
-
-    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final Level level, final Marker marker) {
-        this(out, logger, FQCN, level, marker);
-    }
-
-    @Override
-    public void close() throws IOException {
-        this.out.close();
-        this.logger.close(this.fqcn);
-    }
-
-    @Override
-    public void flush() throws IOException {
-        this.out.flush();
-    }
-
-    @Override
-    public String toString() {
-        return LoggerWriterFilter.class.getSimpleName() + "{writer=" + this.out + '}';
-    }
-
-    @Override
-    public void write(final char[] cbuf) throws IOException {
-        this.out.write(cbuf);
-        this.logger.put(this.fqcn, cbuf, 0, cbuf.length);
-    }
-
-    @Override
-    public void write(final char[] cbuf, final int off, final int len) throws IOException {
-        this.out.write(cbuf, off, len);
-        this.logger.put(this.fqcn, cbuf, off, len);
-    }
-
-    @Override
-    public void write(final int c) throws IOException {
-        this.out.write(c);
-        this.logger.put(this.fqcn, (char) c);
-    }
-
-    @Override
-    public void write(final String str) throws IOException {
-        this.out.write(str);
-        this.logger.put(this.fqcn, str, 0, str.length());
-    }
-
-    @Override
-    public void write(final String str, final int off, final int len) throws IOException {
-        this.out.write(str, off, len);
-        this.logger.put(this.fqcn, str, off, len);
-    }
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9c878544/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerFilterWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerFilterWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerFilterWriterTest.java
new file mode 100644
index 0000000..99a1207
--- /dev/null
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerFilterWriterTest.java
@@ -0,0 +1,18 @@
+package org.apache.logging.log4j.streams;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+public class LoggerFilterWriterTest extends AbstractLoggerWriterTest {
+
+    @Override
+    protected StringWriter createWriter() {
+        return new StringWriter();
+    }
+
+    @Override
+    protected Writer createWriterWrapper() {
+        return new LoggerFilterWriter(this.wrapped, getExtendedLogger(), LEVEL);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9c878544/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
deleted file mode 100644
index 93827b1..0000000
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.logging.log4j.streams;
-
-import java.io.StringWriter;
-import java.io.Writer;
-
-public class LoggerWriterFilterTest extends AbstractLoggerWriterTest {
-
-    @Override
-    protected StringWriter createWriter() {
-        return new StringWriter();
-    }
-
-    @Override
-    protected Writer createWriterWrapper() {
-        return new LoggerWriterFilter(this.wrapped, getExtendedLogger(), LEVEL);
-    }
-
-}


[03/29] git commit: Update Maven plugin maven-bundle-plugin to 2.5.3 from 2.5.0.

Posted by ma...@apache.org.
Update Maven plugin maven-bundle-plugin to 2.5.3 from 2.5.0.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c6f88b60
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c6f88b60
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c6f88b60

Branch: refs/heads/LOG4J2-608
Commit: c6f88b60119693362e59aee7375af454cc2a9eec
Parents: 6a6ba88
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 08:42:52 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 08:42:52 2014 -0400

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c6f88b60/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index eeef103..d10f730 100644
--- a/pom.xml
+++ b/pom.xml
@@ -612,7 +612,7 @@
         <plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
-          <version>2.5.0</version>
+          <version>2.5.3</version>
           <inherited>true</inherited>
           <extensions>true</extensions>
           <executions>


[14/29] git commit: Javadoc: Use the active voice.

Posted by ma...@apache.org.
Javadoc: Use the active voice.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e9a39074
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e9a39074
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e9a39074

Branch: refs/heads/LOG4J2-608
Commit: e9a390748c2ac5e372f16da870741b75dd33239f
Parents: 6e3a565
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:15:37 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:15:37 2014 -0400

----------------------------------------------------------------------
 .../log4j/streams/LoggerInputStream.java        |  9 +++--
 .../log4j/streams/LoggerOutputStream.java       | 16 ++++----
 .../log4j/streams/LoggerPrintStream.java        | 41 +++++++++++---------
 .../log4j/streams/LoggerPrintWriter.java        | 22 +++++------
 .../logging/log4j/streams/LoggerReader.java     |  8 ++--
 5 files changed, 51 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e9a39074/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
index 57a59bd..1ac53ae 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerInputStream.java
@@ -29,8 +29,7 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.ByteStreamLogger;
 
 /**
- * Input stream that logs each line read to a pre-defined level. Can also be configured with a
- * Marker.
+ * Logs each line read to a pre-defined level. Can also be configured with a Marker.
  */
 public class LoggerInputStream extends FilterInputStream {
     private static final String FQCN = LoggerInputStream.class.getName();
@@ -38,7 +37,8 @@ public class LoggerInputStream extends FilterInputStream {
     private final String fqcn;
     private final ByteStreamLogger logger;
 
-    public LoggerInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+    public LoggerInputStream(final InputStream in, final Charset charset, final ExtendedLogger logger,
+            final String fqcn, final Level level, final Marker marker) {
         super(in);
         this.logger = new ByteStreamLogger(logger, level, marker, charset);
         this.fqcn = fqcn;
@@ -48,7 +48,8 @@ public class LoggerInputStream extends FilterInputStream {
         this(in, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level, final Marker marker) {
+    public LoggerInputStream(final InputStream in, final Charset charset, final Logger logger, final Level level,
+            final Marker marker) {
         this(in, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e9a39074/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
index 4b11415..b10f805 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerOutputStream.java
@@ -28,11 +28,10 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.ByteStreamLogger;
 
 /**
- * Output stream that logs each line written to a pre-defined level. Can also be configured with a
- * Marker. This class provides an interface that follows the {@link java.io.OutputStream} methods in
- * spirit, but doesn't require output to any external stream. This class should <em>not</em> be used
- * as a stream for an underlying logger unless it's being used as a bridge. Otherwise, infinite
- * loops may occur!
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.OutputStream} methods in spirit, but doesn't require output to any external stream.
+ * This class should <em>not</em> be used as a stream for an underlying logger unless it's being used as a bridge.
+ * Otherwise, infinite loops may occur!
  */
 public class LoggerOutputStream extends OutputStream {
     private static final String FQCN = LoggerOutputStream.class.getName();
@@ -57,8 +56,8 @@ public class LoggerOutputStream extends OutputStream {
         this(null, Charset.defaultCharset(), (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger, final String fqcn, final Level level,
-            final Marker marker) {
+    public LoggerOutputStream(final OutputStream out, final Charset charset, final ExtendedLogger logger,
+            final String fqcn, final Level level, final Marker marker) {
         this.out = out;
         this.logger = new ByteStreamLogger(logger, level, marker, charset);
         this.fqcn = fqcn;
@@ -68,7 +67,8 @@ public class LoggerOutputStream extends OutputStream {
         this(out, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level, final Marker marker) {
+    public LoggerOutputStream(final OutputStream out, final Charset charset, final Logger logger, final Level level,
+            final Marker marker) {
         this(out, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e9a39074/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
index fe171b1..ad7fcb7 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintStream.java
@@ -30,20 +30,21 @@ import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
 /**
- * Output stream that logs each line written to a pre-defined level. Can also be configured with a
- * Marker. This class provides an interface that follows the {@link java.io.PrintStream} methods in
- * spirit, but doesn't require output to any external stream. This class should <em>not</em> be used
- * as a stream for an underlying logger unless it's being used as a bridge. Otherwise, infinite
- * loops may occur!
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.PrintStream} methods in spirit, but doesn't require output to any external stream.
+ * This class should <em>not</em> be used as a stream for an underlying logger unless it's being used as a bridge.
+ * Otherwise, infinite loops may occur!
  */
 public class LoggerPrintStream extends PrintStream {
     private static final String FQCN = LoggerPrintStream.class.getName();
 
-    public LoggerPrintStream(final Charset charset, final Logger logger, final Level level) throws UnsupportedEncodingException {
+    public LoggerPrintStream(final Charset charset, final Logger logger, final Level level)
+            throws UnsupportedEncodingException {
         this(null, false, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final Charset charset, final Logger logger, final Level level, final Marker marker) throws UnsupportedEncodingException {
+    public LoggerPrintStream(final Charset charset, final Logger logger, final Level level, final Marker marker)
+            throws UnsupportedEncodingException {
         this(null, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
@@ -55,22 +56,24 @@ public class LoggerPrintStream extends PrintStream {
         this(null, false, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final ExtendedLogger logger, final String fqcn,
-            final Level level, final Marker marker) throws UnsupportedEncodingException {
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset,
+            final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker)
+            throws UnsupportedEncodingException {
         super(new LoggerOutputStream(out, charset, logger, fqcn, level, marker), autoFlush, charset.name());
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final Logger logger, final Level level)
-            throws UnsupportedEncodingException {
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset,
+            final Logger logger, final Level level) throws UnsupportedEncodingException {
         this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset, final Logger logger, final Level level, final Marker marker)
-            throws UnsupportedEncodingException {
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Charset charset,
+            final Logger logger, final Level level, final Marker marker) throws UnsupportedEncodingException {
         this(out, autoFlush, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final ExtendedLogger logger,
+            final String fqcn, final Level level, final Marker marker) {
         super(new LoggerOutputStream(out, Charset.defaultCharset(), logger, fqcn, level, marker), autoFlush);
     }
 
@@ -78,16 +81,18 @@ public class LoggerPrintStream extends PrintStream {
         this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level, final Marker marker) {
+    public LoggerPrintStream(final OutputStream out, final boolean autoFlush, final Logger logger, final Level level,
+            final Marker marker) {
         this(out, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level) throws UnsupportedEncodingException {
+    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level)
+            throws UnsupportedEncodingException {
         this(out, false, charset, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level, final Marker marker)
-            throws UnsupportedEncodingException {
+    public LoggerPrintStream(final OutputStream out, final Charset charset, final Logger logger, final Level level,
+            final Marker marker) throws UnsupportedEncodingException {
         this(out, false, charset, (ExtendedLogger) logger, FQCN, level, marker);
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e9a39074/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index e896329..1dc6e4f 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -27,9 +27,8 @@ import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 
 /**
- * Print Writer that logs each line written to a pre-defined level. Can also be configured with a
- * Marker. This class provides an interface that follows the {@link java.io.PrintWriter} methods in
- * spirit, but doesn't require output to any external writer. 
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.PrintWriter} methods in spirit, but doesn't require output to any external writer.
  */
 public class LoggerPrintWriter extends PrintWriter {
     private static final String FQCN = LoggerPrintWriter.class.getName();
@@ -49,8 +48,8 @@ public class LoggerPrintWriter extends PrintWriter {
     }
 
     @SuppressWarnings("resource")
-    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final String fqcn,
-            final Level level, final Marker marker) {
+    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger,
+            final String fqcn, final Level level, final Marker marker) {
         super(new LoggerWriterFilter(writer, logger, fqcn, level, marker), autoFlush);
     }
 
@@ -58,7 +57,8 @@ public class LoggerPrintWriter extends PrintWriter {
         this(writer, autoFlush, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final Logger logger, final Level level, final Marker marker) {
+    public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final Logger logger, final Level level,
+            final Marker marker) {
         this(writer, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
@@ -75,24 +75,24 @@ public class LoggerPrintWriter extends PrintWriter {
         super.append(c);
         return this;
     }
-    
+
     @Override
     public LoggerPrintWriter append(final CharSequence csq) {
         super.append(csq);
         return this;
     }
-    
+
     @Override
     public LoggerPrintWriter append(final CharSequence csq, final int start, final int end) {
         super.append(csq, start, end);
         return this;
     }
-    
+
     @Override
     public boolean checkError() {
         return super.checkError();
     }
-    
+
     @Override
     public void close() {
         super.close();
@@ -241,7 +241,7 @@ public class LoggerPrintWriter extends PrintWriter {
     public void write(final int c) {
         super.write(c);
     }
-    
+
     @Override
     public void write(final String s) {
         super.write(s);

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e9a39074/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
index 39fa6fe..d156f67 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerReader.java
@@ -29,9 +29,8 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
 
 /**
- * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker.
- * This class provides an interface that follows the {@link java.io.Writer} methods in spirit, but
- * doesn't require output to any external writer.
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external writer.
  */
 public class LoggerReader extends FilterReader {
     private static final String FQCN = LoggerReader.class.getName();
@@ -39,7 +38,8 @@ public class LoggerReader extends FilterReader {
     private final CharStreamLogger logger;
     private final String fqcn;
 
-    public LoggerReader(final Reader reader, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+    public LoggerReader(final Reader reader, final ExtendedLogger logger, final String fqcn, final Level level,
+            final Marker marker) {
         super(reader);
         this.logger = new CharStreamLogger(logger, level, marker);
         this.fqcn = fqcn;


[15/29] git commit: Javadoc.

Posted by ma...@apache.org.
Javadoc.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a15493a8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a15493a8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a15493a8

Branch: refs/heads/LOG4J2-608
Commit: a15493a8b7ed3761e60c21834dafb59d553d052c
Parents: e9a3907
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:19:01 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:19:01 2014 -0400

----------------------------------------------------------------------
 .../org/apache/logging/log4j/streams/LoggerPrintWriter.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a15493a8/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index 1dc6e4f..b0861ed 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -29,6 +29,11 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 /**
  * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
  * that follows the {@link java.io.PrintWriter} methods in spirit, but doesn't require output to any external writer.
+ * <p>
+ * Integration with JDBC logging can be as simple as:
+ * </p>
+ * <pre>DriverManager.setLogWriter(new LoggerPrintWriter(LogManager.getLogger(), Level.DEBUG));
+ * </pre>
  */
 public class LoggerPrintWriter extends PrintWriter {
     private static final String FQCN = LoggerPrintWriter.class.getName();


[25/29] git commit: Better param name: sz -> size.

Posted by ma...@apache.org.
Better param name: sz -> size.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/41af200e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/41af200e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/41af200e

Branch: refs/heads/LOG4J2-608
Commit: 41af200e67f9336545195c5c14c61ac439889e6d
Parents: c3718e4
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 11:02:17 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 11:02:17 2014 -0400

----------------------------------------------------------------------
 .../log4j/streams/LoggerBufferedInputStream.java        | 12 ++++++------
 .../logging/log4j/streams/LoggerBufferedReader.java     | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/41af200e/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
index 041fdac..1ffeaac 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedInputStream.java
@@ -58,16 +58,16 @@ public class LoggerBufferedInputStream extends BufferedInputStream {
         this(in, Charset.defaultCharset(), logger, fqcn, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        this(in, Charset.defaultCharset(), sz, logger, fqcn, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final int size, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        this(in, Charset.defaultCharset(), size, logger, fqcn, level, marker);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int sz, final Logger logger, final Level level) {
-        this(in, sz, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedInputStream(final InputStream in, final int size, final Logger logger, final Level level) {
+        this(in, size, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedInputStream(final InputStream in, final int sz, final Logger logger, final Level level, final Marker marker) {
-        this(in, sz, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedInputStream(final InputStream in, final int size, final Logger logger, final Level level, final Marker marker) {
+        this(in, size, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
     public LoggerBufferedInputStream(final InputStream in, final Logger logger, final Level level) {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/41af200e/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
index 74651a2..db89101 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerBufferedReader.java
@@ -34,16 +34,16 @@ public class LoggerBufferedReader extends BufferedReader {
         super(new LoggerReader(reader, logger, FQCN, level, marker));
     }
 
-    public LoggerBufferedReader(final Reader reader, final int sz, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        super(new LoggerReader(reader, logger, FQCN, level, marker), sz);
+    public LoggerBufferedReader(final Reader reader, final int size, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
+        super(new LoggerReader(reader, logger, FQCN, level, marker), size);
     }
 
-    public LoggerBufferedReader(final Reader reader, final int sz, final Logger logger, final Level level) {
-        this(reader, sz, (ExtendedLogger) logger, FQCN, level, null);
+    public LoggerBufferedReader(final Reader reader, final int size, final Logger logger, final Level level) {
+        this(reader, size, (ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerBufferedReader(final Reader reader, final int sz, final Logger logger, final Level level, final Marker marker) {
-        this(reader, sz, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerBufferedReader(final Reader reader, final int size, final Logger logger, final Level level, final Marker marker) {
+        this(reader, size, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
     public LoggerBufferedReader(final Reader reader, final Logger logger, final Level level) {


[07/29] git commit: Move longish comment before code.

Posted by ma...@apache.org.
Move longish comment before code.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/acba5dc8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/acba5dc8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/acba5dc8

Branch: refs/heads/LOG4J2-608
Commit: acba5dc889c865b18b1a9bd008a8cffab1308703
Parents: a497e40
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 09:45:30 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 09:45:30 2014 -0400

----------------------------------------------------------------------
 .../org/apache/logging/log4j/streams/util/CharStreamLogger.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/acba5dc8/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
index 4e136ed..3eb0851 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
@@ -103,8 +103,8 @@ public class CharStreamLogger {
     }
 
     private void log(final String fqcn) {
-        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
-                                                         // work
+        // convert to string now so async loggers work
+        logger.logIfEnabled(fqcn, level, marker, msg.toString());
         msg.setLength(0);
     }
 }


[09/29] Sort methods in AB order.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
index 09e5269..4c0741d 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
@@ -32,30 +32,35 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
     protected ByteArrayOutputStream read;
     protected InputStream in;
 
+    protected InputStream createInputStream() {
+        return new LoggerInputStream(wrapped, getLogger(), LEVEL);
+    }
+
     @Before
     public void createStream() {
         wrapped = new ByteArrayInputStream((FIRST + "\r\n" + LAST).getBytes());
         read = new ByteArrayOutputStream();
         in = createInputStream();
     }
-
-    protected InputStream createInputStream() {
-        return new LoggerInputStream(wrapped, getLogger(), LEVEL);
-    }
     
     @Test
-    public void testRead_int() throws Exception {
-        for (int i = 0; i < FIRST.length(); i++) {
-            read.write(in.read());
-        }
-        if (!(in instanceof BufferedInputStream)) {
-            assertMessages();
-        }
-        assertEquals("carriage return", '\r', in.read());
-        if (!(in instanceof BufferedInputStream)) {
-            assertMessages();
-        }
-        assertEquals("newline", '\n', in.read());
+    public void testClose_HasRemainingData() throws IOException {
+        final byte[] bytes = new byte[1024];
+        in.read(bytes);
+        assertMessages(FIRST);
+        in.close();
+        assertMessages(FIRST, LAST);
+    }
+
+    @Test
+    public void testClose_NoRemainingData() throws IOException {
+        wrapped = new ByteArrayInputStream((FIRST + '\n').getBytes());
+        in = new LoggerInputStream(wrapped, getLogger(), LEVEL);
+
+        final byte[] bytes = new byte[1024];
+        in.read(bytes);
+        assertMessages(FIRST);
+        in.close();
         assertMessages(FIRST);
     }
 
@@ -93,6 +98,22 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
     }
 
     @Test
+    public void testRead_int() throws Exception {
+        for (int i = 0; i < FIRST.length(); i++) {
+            read.write(in.read());
+        }
+        if (!(in instanceof BufferedInputStream)) {
+            assertMessages();
+        }
+        assertEquals("carriage return", '\r', in.read());
+        if (!(in instanceof BufferedInputStream)) {
+            assertMessages();
+        }
+        assertEquals("newline", '\n', in.read());
+        assertMessages(FIRST);
+    }
+
+    @Test
     public void testRead_MultipleLines() throws IOException {
         wrapped = new ByteArrayInputStream((FIRST + "\n" + LAST + '\n').getBytes());
         in = new LoggerInputStream(wrapped, getLogger(), LEVEL);
@@ -103,25 +124,4 @@ public class LoggerInputStreamTest extends AbstractStreamTest {
         assertMessages(FIRST, LAST);
         assertEquals(FIRST + '\n' + LAST + '\n', read.toString());
     }
-
-    @Test
-    public void testClose_NoRemainingData() throws IOException {
-        wrapped = new ByteArrayInputStream((FIRST + '\n').getBytes());
-        in = new LoggerInputStream(wrapped, getLogger(), LEVEL);
-
-        final byte[] bytes = new byte[1024];
-        in.read(bytes);
-        assertMessages(FIRST);
-        in.close();
-        assertMessages(FIRST);
-    }
-
-    @Test
-    public void testClose_HasRemainingData() throws IOException {
-        final byte[] bytes = new byte[1024];
-        in.read(bytes);
-        assertMessages(FIRST);
-        in.close();
-        assertMessages(FIRST, LAST);
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
index 4b9aa36..8a3d238 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
@@ -33,25 +33,43 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
     protected ByteArrayOutputStream wrapped;
     protected OutputStream out;
 
+    protected OutputStream createOutputStream() {
+        return new LoggerOutputStream(wrapped, getLogger(), Level.ERROR);
+    }
+
     @Before
     public void createStream() {
         wrapped = new ByteArrayOutputStream();
         out = createOutputStream();
     }
 
-    protected OutputStream createOutputStream() {
-        return new LoggerOutputStream(wrapped, getLogger(), Level.ERROR);
+    @Test
+    public void testClose_HasRemainingData() throws IOException {
+        out.write(FIRST.getBytes());
+        assertMessages();
+        out.close();
+        assertMessages(FIRST);
+        assertEquals(FIRST, wrapped.toString());
     }
 
     @Test
-    public void testWrite_Int() throws Exception {
-        for (final byte b : "int".getBytes()) {
-            out.write(b);
-            assertMessages();
-        }
-        out.write('\n');
-        assertMessages("int");
-        assertEquals("int" + '\n', wrapped.toString());
+    public void testClose_NoRemainingData() throws IOException {
+        out.close();
+        assertMessages();
+        assertEquals("", wrapped.toString());
+    }
+
+    @Test
+    public void testFlush() throws IOException {
+        final OutputStream out = EasyMock.createMock("out", OutputStream.class);
+        out.flush(); // expect the flush to come through to the mocked OutputStream
+        out.close();
+        replay(out);
+        
+        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
+        los.flush();
+        los.close();
+        verify(out);
     }
 
     @Test
@@ -88,38 +106,20 @@ public class LoggerOutputStreamTest extends AbstractStreamTest {
     }
 
     @Test
+    public void testWrite_Int() throws Exception {
+        for (final byte b : "int".getBytes()) {
+            out.write(b);
+            assertMessages();
+        }
+        out.write('\n');
+        assertMessages("int");
+        assertEquals("int" + '\n', wrapped.toString());
+    }
+
+    @Test
     public void testWrite_MultipleLines() throws IOException {
         out.write((FIRST + '\n' + LAST + '\n').getBytes());
         assertMessages(FIRST, LAST);
         assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
     }
-
-    @Test
-    public void testFlush() throws IOException {
-        final OutputStream out = EasyMock.createMock("out", OutputStream.class);
-        out.flush(); // expect the flush to come through to the mocked OutputStream
-        out.close();
-        replay(out);
-        
-        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
-        los.flush();
-        los.close();
-        verify(out);
-    }
-
-    @Test
-    public void testClose_NoRemainingData() throws IOException {
-        out.close();
-        assertMessages();
-        assertEquals("", wrapped.toString());
-    }
-
-    @Test
-    public void testClose_HasRemainingData() throws IOException {
-        out.write(FIRST.getBytes());
-        assertMessages();
-        out.close();
-        assertMessages(FIRST);
-        assertEquals(FIRST, wrapped.toString());
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
index ebd57cf..e2c7f2b 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamCallerInfoTest.java
@@ -26,29 +26,12 @@ public class LoggerPrintStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
 
     private LoggerPrintStream logOut;
     
-    @Before
-    public void setupStreams() {
-        logOut = new LoggerPrintStream(getLogger(), Level.WARN);
-    }
-    
     @Test
-    public void write_int() throws Exception {
-        logOut.write('a');
-        assertMessages("write int", 0, "write_int");
-        logOut.write('\n');
-        assertMessages("write newline", 1, "write_int");
-    }
-    
-    @Test
-    public void write_bytes() throws Exception {
-        logOut.write("b\n".getBytes());
-        assertMessages("write", 1, "write_bytes");
-    }
-    
-    @Test
-    public void write_bytes_offset() throws Exception {
-        logOut.write("c\n".getBytes(), 0, 2);
-        assertMessages("write", 1, "write_bytes_offset");
+    public void close() throws Exception {
+        logOut.print("a\nb");
+        assertMessages("before close size", 1, "close");
+        logOut.close();
+        assertMessages("after close size", 2, "close");
     }
     
     @Test
@@ -116,6 +99,18 @@ public class LoggerPrintStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
     }
     
     @Test
+    public void print_printf() throws Exception {
+        logOut.printf("a\n");
+        assertMessages("println", 1, "print_printf");
+    }
+    
+    @Test
+    public void print_printf_locale() throws Exception {
+        logOut.printf(Locale.getDefault(), "a\n");
+        assertMessages("println", 1, "print_printf_locale");
+    }
+    
+    @Test
     public void print_string() throws Exception {
         logOut.print("a");
         assertMessages("print", 0, "print_string");
@@ -123,23 +118,28 @@ public class LoggerPrintStreamCallerInfoTest extends LoggerStreamsCallerInfoTest
         assertMessages("println", 1, "print_string");
     }
     
+    @Before
+    public void setupStreams() {
+        logOut = new LoggerPrintStream(getLogger(), Level.WARN);
+    }
+    
     @Test
-    public void print_printf() throws Exception {
-        logOut.printf("a\n");
-        assertMessages("println", 1, "print_printf");
+    public void write_bytes() throws Exception {
+        logOut.write("b\n".getBytes());
+        assertMessages("write", 1, "write_bytes");
     }
     
     @Test
-    public void print_printf_locale() throws Exception {
-        logOut.printf(Locale.getDefault(), "a\n");
-        assertMessages("println", 1, "print_printf_locale");
+    public void write_bytes_offset() throws Exception {
+        logOut.write("c\n".getBytes(), 0, 2);
+        assertMessages("write", 1, "write_bytes_offset");
     }
     
     @Test
-    public void close() throws Exception {
-        logOut.print("a\nb");
-        assertMessages("before close size", 1, "close");
-        logOut.close();
-        assertMessages("after close size", 2, "close");
+    public void write_int() throws Exception {
+        logOut.write('a');
+        assertMessages("write int", 0, "write_int");
+        logOut.write('\n');
+        assertMessages("write newline", 1, "write_int");
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
index 1f5e324..864d300 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintStreamTest.java
@@ -32,6 +32,15 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
     }
 
     @Test
+    public void testFormat() throws Exception {
+        assertSame(print, print.format("[%s]", FIRST));
+        assertMessages();
+        print.println();
+        assertMessages("[" + FIRST + "]");
+        assertEquals("[" + FIRST + "]" + NEWLINE, wrapped.toString());
+    }
+
+    @Test
     public void testPrint_boolean() throws Exception {
         print.print(true);
         assertMessages();
@@ -52,6 +61,15 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
     }
 
     @Test
+    public void testPrint_CharacterArray() throws Exception {
+        print.print(FIRST.toCharArray());
+        assertMessages();
+        print.println();
+        assertMessages(FIRST);
+        assertEquals(FIRST + NEWLINE, wrapped.toString());
+    }
+
+    @Test
     public void testPrint_int() throws Exception {
         print.print(12);
         assertMessages();
@@ -70,8 +88,8 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
     }
 
     @Test
-    public void testPrint_CharacterArray() throws Exception {
-        print.print(FIRST.toCharArray());
+    public void testPrint_Object() throws Exception {
+        print.print((Object) FIRST);
         assertMessages();
         print.println();
         assertMessages(FIRST);
@@ -88,15 +106,6 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
     }
 
     @Test
-    public void testPrint_Object() throws Exception {
-        print.print((Object) FIRST);
-        assertMessages();
-        print.println();
-        assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
-    }
-
-    @Test
     public void testPrintf() throws Exception {
         assertSame(print,  print.printf("<<<%s>>>", FIRST));
         assertMessages();
@@ -104,13 +113,4 @@ public class LoggerPrintStreamTest extends LoggerOutputStreamTest {
         assertMessages("<<<" + FIRST + ">>>");
         assertEquals("<<<" + FIRST + ">>>" + NEWLINE, wrapped.toString());
     }
-
-    @Test
-    public void testFormat() throws Exception {
-        assertSame(print, print.format("[%s]", FIRST));
-        assertMessages();
-        print.println();
-        assertMessages("[" + FIRST + "]");
-        assertEquals("[" + FIRST + "]" + NEWLINE, wrapped.toString());
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
index 2b825ec..f3133e2 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterCallerInfoTest.java
@@ -26,29 +26,12 @@ public class LoggerPrintWriterCallerInfoTest extends LoggerStreamsCallerInfoTest
 
     private LoggerPrintWriter logOut;
     
-    @Before
-    public void setupStreams() {
-        logOut = new LoggerPrintWriter(getLogger(), Level.WARN);
-    }
-    
     @Test
-    public void write_int() throws Exception {
-        logOut.write('a');
-        assertMessages("write int", 0, "write_int");
-        logOut.write('\n');
-        assertMessages("write newline", 1, "write_int");
-    }
-    
-    @Test
-    public void write_bytes() throws Exception {
-        logOut.write("b\n".toCharArray());
-        assertMessages("write", 1, "write_bytes");
-    }
-    
-    @Test
-    public void write_bytes_offset() throws Exception {
-        logOut.write("c\n".toCharArray(), 0, 2);
-        assertMessages("write", 1, "write_bytes_offset");
+    public void close() throws Exception {
+        logOut.print("a\nb");
+        assertMessages("before close size", 1, "close");
+        logOut.close();
+        assertMessages("after close size", 2, "close");
     }
     
     @Test
@@ -116,6 +99,18 @@ public class LoggerPrintWriterCallerInfoTest extends LoggerStreamsCallerInfoTest
     }
     
     @Test
+    public void print_printf() throws Exception {
+        logOut.printf("a\n");
+        assertMessages("println", 1, "print_printf");
+    }
+    
+    @Test
+    public void print_printf_locale() throws Exception {
+        logOut.printf(Locale.getDefault(), "a\n");
+        assertMessages("println", 1, "print_printf_locale");
+    }
+    
+    @Test
     public void print_string() throws Exception {
         logOut.print("a");
         assertMessages("print", 0, "print_string");
@@ -123,23 +118,28 @@ public class LoggerPrintWriterCallerInfoTest extends LoggerStreamsCallerInfoTest
         assertMessages("println", 1, "print_string");
     }
     
+    @Before
+    public void setupStreams() {
+        logOut = new LoggerPrintWriter(getLogger(), Level.WARN);
+    }
+    
     @Test
-    public void print_printf() throws Exception {
-        logOut.printf("a\n");
-        assertMessages("println", 1, "print_printf");
+    public void write_bytes() throws Exception {
+        logOut.write("b\n".toCharArray());
+        assertMessages("write", 1, "write_bytes");
     }
     
     @Test
-    public void print_printf_locale() throws Exception {
-        logOut.printf(Locale.getDefault(), "a\n");
-        assertMessages("println", 1, "print_printf_locale");
+    public void write_bytes_offset() throws Exception {
+        logOut.write("c\n".toCharArray(), 0, 2);
+        assertMessages("write", 1, "write_bytes_offset");
     }
     
     @Test
-    public void close() throws Exception {
-        logOut.print("a\nb");
-        assertMessages("before close size", 1, "close");
-        logOut.close();
-        assertMessages("after close size", 2, "close");
+    public void write_int() throws Exception {
+        logOut.write('a');
+        assertMessages("write int", 0, "write_int");
+        logOut.write('\n');
+        assertMessages("write newline", 1, "write_int");
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index 7bc799c..212efd5 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -39,6 +39,15 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
     }
 
     @Test
+    public void testFormat() throws Exception {
+        assertSame(print, print.format("[%s]", FIRST));
+        assertMessages();
+        print.println();
+        assertMessages("[" + FIRST + "]");
+        assertEquals("[" + FIRST + "]" + NEWLINE, wrapped.toString());
+    }
+
+    @Test
     public void testPrint_boolean() throws Exception {
         print.print(true);
         assertMessages();
@@ -59,6 +68,15 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
     }
 
     @Test
+    public void testPrint_CharacterArray() throws Exception {
+        print.print(FIRST.toCharArray());
+        assertMessages();
+        print.println();
+        assertMessages(FIRST);
+        assertEquals(FIRST + NEWLINE, wrapped.toString());
+    }
+
+    @Test
     public void testPrint_int() throws Exception {
         print.print(12);
         assertMessages();
@@ -77,8 +95,8 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
     }
 
     @Test
-    public void testPrint_CharacterArray() throws Exception {
-        print.print(FIRST.toCharArray());
+    public void testPrint_Object() throws Exception {
+        print.print((Object) FIRST);
         assertMessages();
         print.println();
         assertMessages(FIRST);
@@ -95,15 +113,6 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
     }
 
     @Test
-    public void testPrint_Object() throws Exception {
-        print.print((Object) FIRST);
-        assertMessages();
-        print.println();
-        assertMessages(FIRST);
-        assertEquals(FIRST + NEWLINE, wrapped.toString());
-    }
-
-    @Test
     public void testPrintf() throws Exception {
         assertSame(print,  print.printf("<<<%s>>>", FIRST));
         assertMessages();
@@ -111,13 +120,4 @@ public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
         assertMessages("<<<" + FIRST + ">>>");
         assertEquals("<<<" + FIRST + ">>>" + NEWLINE, wrapped.toString());
     }
-
-    @Test
-    public void testFormat() throws Exception {
-        assertSame(print, print.format("[%s]", FIRST));
-        assertMessages();
-        print.println();
-        assertMessages("[" + FIRST + "]");
-        assertEquals("[" + FIRST + "]" + NEWLINE, wrapped.toString());
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
index cce13f4..18a8cdf 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderCallerInfoTest.java
@@ -27,12 +27,6 @@ public class LoggerReaderCallerInfoTest extends LoggerStreamsCallerInfoTesting {
 
     LoggerReader logReader;
     
-    @Before
-    public void setupReader() {
-        final Reader srcReader = new StringReader("a\nb\nc\nd\ne");
-        logReader = new LoggerReader(srcReader, getLogger(), LEVEL);
-    }
-
     @Test
     public void read() throws Exception {
         logReader.read();
@@ -54,4 +48,10 @@ public class LoggerReaderCallerInfoTest extends LoggerStreamsCallerInfoTesting {
         logReader.close();
         assertMessages("after close size", 5, "read");
     }
+
+    @Before
+    public void setupReader() {
+        final Reader srcReader = new StringReader("a\nb\nc\nd\ne");
+        logReader = new LoggerReader(srcReader, getLogger(), LEVEL);
+    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
index 8ac5ec9..14d0ac1 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
@@ -33,30 +33,37 @@ public class LoggerReaderTest extends AbstractStreamTest {
     protected StringWriter read;
     protected Reader reader;
 
+    protected Reader createReader() {
+        return new LoggerReader(wrapped, getLogger(), LEVEL);
+    }
+    
     @Before
     public void createStream() {
         wrapped = new StringReader(FIRST + "\r\n" + LAST);
         read = new StringWriter();
         reader = createReader();
     }
-    
-    protected Reader createReader() {
-        return new LoggerReader(wrapped, getLogger(), LEVEL);
-    }
 
     @Test
-    public void testRead_int() throws Exception {
-        for (int i = 0; i < FIRST.length(); i++) {
-            read.write(reader.read());
-        }
-        if (!(reader instanceof BufferedReader)) {
-            assertMessages();
-        }
-        assertEquals("carriage return", '\r', reader.read());
+    public void testClose_HasRemainingData() throws IOException {
+        final char[] chars = new char[1024];
+        reader.read(chars);
         if (!(reader instanceof BufferedReader)) {
-            assertMessages();
+            assertMessages(FIRST);
         }
-        assertEquals("newline", '\n', reader.read());
+        reader.close();
+        assertMessages(FIRST, LAST);
+    }
+
+    @Test
+    public void testClose_NoRemainingData() throws IOException {
+        wrapped = new StringReader(FIRST + '\n');
+        reader = createReader();
+
+        final char[] chars = new char[1024];
+        reader.read(chars);
+        assertMessages(FIRST);
+        reader.close();
         assertMessages(FIRST);
     }
 
@@ -105,6 +112,22 @@ public class LoggerReaderTest extends AbstractStreamTest {
     }
 
     @Test
+    public void testRead_int() throws Exception {
+        for (int i = 0; i < FIRST.length(); i++) {
+            read.write(reader.read());
+        }
+        if (!(reader instanceof BufferedReader)) {
+            assertMessages();
+        }
+        assertEquals("carriage return", '\r', reader.read());
+        if (!(reader instanceof BufferedReader)) {
+            assertMessages();
+        }
+        assertEquals("newline", '\n', reader.read());
+        assertMessages(FIRST);
+    }
+
+    @Test
     public void testRead_MultipleLines() throws IOException {
         wrapped = new StringReader(FIRST + "\n" + LAST + '\n');
         reader = createReader();
@@ -115,27 +138,4 @@ public class LoggerReaderTest extends AbstractStreamTest {
         assertMessages(FIRST, LAST);
         assertEquals(FIRST + '\n' + LAST + '\n', read.toString());
     }
-
-    @Test
-    public void testClose_NoRemainingData() throws IOException {
-        wrapped = new StringReader(FIRST + '\n');
-        reader = createReader();
-
-        final char[] chars = new char[1024];
-        reader.read(chars);
-        assertMessages(FIRST);
-        reader.close();
-        assertMessages(FIRST);
-    }
-
-    @Test
-    public void testClose_HasRemainingData() throws IOException {
-        final char[] chars = new char[1024];
-        reader.read(chars);
-        if (!(reader instanceof BufferedReader)) {
-            assertMessages(FIRST);
-        }
-        reader.close();
-        assertMessages(FIRST, LAST);
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/30ef44b5/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
index 5d81380..73f22a0 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerStreamsCallerInfoTesting.java
@@ -27,19 +27,14 @@ import org.junit.ClassRule;
 
 public class LoggerStreamsCallerInfoTesting {
 
-    protected final static Level LEVEL = Level.WARN;
-    
-    @ClassRule
-    public static InitialLoggerContext ctx = new InitialLoggerContext("log4j2-streams-calling-info.xml");
-
     protected static Logger getLogger() {
         return ctx.getLogger("ClassAndMethodLogger");
     }
+    
+    protected final static Level LEVEL = Level.WARN;
 
-    @Before
-    public void clearAppender() {
-        ((ListAppender) ctx.getAppender("ClassAndMethod")).clear();
-    }
+    @ClassRule
+    public static InitialLoggerContext ctx = new InitialLoggerContext("log4j2-streams-calling-info.xml");
 
     public void assertMessages(final String msg, final int size, final String methodName) {
         final ListAppender appender = (ListAppender) ctx.getAppender("ClassAndMethod");
@@ -48,4 +43,9 @@ public class LoggerStreamsCallerInfoTesting {
             assertEquals(msg + " has incorrect caller info", this.getClass().getName() + '.' + methodName, message);
         }
     }
+
+    @Before
+    public void clearAppender() {
+        ((ListAppender) ctx.getAppender("ClassAndMethod")).clear();
+    }
 }


[18/29] git commit: Do not assign to params for easier debugging.

Posted by ma...@apache.org.
Do not assign to params for easier debugging.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/8db77320
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/8db77320
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/8db77320

Branch: refs/heads/LOG4J2-608
Commit: 8db773208fbc9aee299138b16838763b291fa59b
Parents: 7f969fa
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:39:23 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:39:23 2014 -0400

----------------------------------------------------------------------
 .../logging/log4j/streams/ByteStreamLogger.java     | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8db77320/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
index bbc9098..6efa138 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/ByteStreamLogger.java
@@ -119,17 +119,19 @@ public class ByteStreamLogger {
         }
     }
 
-    public void put(final String fqcn, final byte[] b, int off, int len) throws IOException {
-        if (len >= 0) {
+    public void put(final String fqcn, final byte[] b, final int off, final int len) throws IOException {
+        int curLen = len;
+        int curOff = off;
+        if (curLen >= 0) {
             synchronized (this.msg) {
-                while (len > this.buf.remaining()) {
+                while (curLen > this.buf.remaining()) {
                     final int remaining = this.buf.remaining();
-                    this.buf.put(b, off, remaining);
-                    len -= remaining;
-                    off += remaining;
+                    this.buf.put(b, curOff, remaining);
+                    curLen -= remaining;
+                    curOff += remaining;
                     extractMessages(fqcn);
                 }
-                this.buf.put(b, off, len);
+                this.buf.put(b, curOff, curLen);
                 extractMessages(fqcn);
             }
         } else {


[13/29] git commit: Javadoc: Use the active voice.

Posted by ma...@apache.org.
Javadoc: Use the active voice.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6e3a5657
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6e3a5657
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6e3a5657

Branch: refs/heads/LOG4J2-608
Commit: 6e3a56571c0dfa401ee6fa2f28cba99ad61e61e0
Parents: 9383cbc
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:14:43 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:14:43 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/streams/LoggerWriter.java     | 5 ++---
 .../org/apache/logging/log4j/streams/LoggerWriterFilter.java    | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6e3a5657/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index ee10247..d663fc2 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -27,9 +27,8 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
 
 /**
- * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides
- * an interface that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external
- * writer.
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external writer.
  */
 public class LoggerWriter extends Writer {
     private static final String FQCN = LoggerWriter.class.getName();

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6e3a5657/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
index f583e5b..858ac11 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
@@ -28,9 +28,8 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
 
 /**
- * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides
- * an interface that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external
- * out.
+ * Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface
+ * that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external out.
  */
 public class LoggerWriterFilter extends FilterWriter {
     private static final String FQCN = LoggerWriterFilter.class.getName();


[16/29] Add 'this' qualifier to unqualified field accesses.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
index 14d0ac1..6ca45a9 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
@@ -34,108 +34,108 @@ public class LoggerReaderTest extends AbstractStreamTest {
     protected Reader reader;
 
     protected Reader createReader() {
-        return new LoggerReader(wrapped, getLogger(), LEVEL);
+        return new LoggerReader(this.wrapped, getLogger(), LEVEL);
     }
     
     @Before
     public void createStream() {
-        wrapped = new StringReader(FIRST + "\r\n" + LAST);
-        read = new StringWriter();
-        reader = createReader();
+        this.wrapped = new StringReader(FIRST + "\r\n" + LAST);
+        this.read = new StringWriter();
+        this.reader = createReader();
     }
 
     @Test
     public void testClose_HasRemainingData() throws IOException {
         final char[] chars = new char[1024];
-        reader.read(chars);
-        if (!(reader instanceof BufferedReader)) {
+        this.reader.read(chars);
+        if (!(this.reader instanceof BufferedReader)) {
             assertMessages(FIRST);
         }
-        reader.close();
+        this.reader.close();
         assertMessages(FIRST, LAST);
     }
 
     @Test
     public void testClose_NoRemainingData() throws IOException {
-        wrapped = new StringReader(FIRST + '\n');
-        reader = createReader();
+        this.wrapped = new StringReader(FIRST + '\n');
+        this.reader = createReader();
 
         final char[] chars = new char[1024];
-        reader.read(chars);
+        this.reader.read(chars);
         assertMessages(FIRST);
-        reader.close();
+        this.reader.close();
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_CharArray() throws Exception {
         final char[] chars = new char[FIRST.length()];
-        assertEquals("len", FIRST.length(), reader.read(chars));
-        if (!(reader instanceof BufferedReader)) {
+        assertEquals("len", FIRST.length(), this.reader.read(chars));
+        if (!(this.reader instanceof BufferedReader)) {
             assertMessages();
         }
-        reader.read(chars);
+        this.reader.read(chars);
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_CharArray_Offset_Length() throws Exception {
         final char[] chars = new char[1024];
-        assertEquals("len", FIRST.length(), reader.read(chars, 0, FIRST.length()));
-        if (!(reader instanceof BufferedReader)) {
+        assertEquals("len", FIRST.length(), this.reader.read(chars, 0, FIRST.length()));
+        if (!(this.reader instanceof BufferedReader)) {
             assertMessages();
         }
-        reader.read(chars);
-        reader.close();
+        this.reader.read(chars);
+        this.reader.close();
         assertMessages(FIRST, LAST);
     }
 
     @Test
     public void testRead_CharBuffer() throws Exception {
         final CharBuffer chars = CharBuffer.allocate(1024);
-        assertEquals("len", FIRST.length() + LAST.length() + 2, reader.read(chars));
-        reader.close();
+        assertEquals("len", FIRST.length() + LAST.length() + 2, this.reader.read(chars));
+        this.reader.close();
         assertMessages(FIRST, LAST);
     }
 
     @Test
     public void testRead_IgnoresWindowsNewline() throws IOException {
         final char[] chars = new char[1024];
-        final int len = reader.read(chars);
-        read.write(chars, 0, len);
-        if (!(reader instanceof BufferedReader)) {
+        final int len = this.reader.read(chars);
+        this.read.write(chars, 0, len);
+        if (!(this.reader instanceof BufferedReader)) {
             assertMessages(FIRST);
         }
-        assertEquals(FIRST + "\r\n" + LAST, read.toString());
-        reader.close();
+        assertEquals(FIRST + "\r\n" + LAST, this.read.toString());
+        this.reader.close();
         assertMessages(FIRST, LAST);
     }
 
     @Test
     public void testRead_int() throws Exception {
         for (int i = 0; i < FIRST.length(); i++) {
-            read.write(reader.read());
+            this.read.write(this.reader.read());
         }
-        if (!(reader instanceof BufferedReader)) {
+        if (!(this.reader instanceof BufferedReader)) {
             assertMessages();
         }
-        assertEquals("carriage return", '\r', reader.read());
-        if (!(reader instanceof BufferedReader)) {
+        assertEquals("carriage return", '\r', this.reader.read());
+        if (!(this.reader instanceof BufferedReader)) {
             assertMessages();
         }
-        assertEquals("newline", '\n', reader.read());
+        assertEquals("newline", '\n', this.reader.read());
         assertMessages(FIRST);
     }
 
     @Test
     public void testRead_MultipleLines() throws IOException {
-        wrapped = new StringReader(FIRST + "\n" + LAST + '\n');
-        reader = createReader();
+        this.wrapped = new StringReader(FIRST + "\n" + LAST + '\n');
+        this.reader = createReader();
 
         final char[] chars = new char[1024];
-        final int len = reader.read(chars);
-        read.write(chars, 0, len);
+        final int len = this.reader.read(chars);
+        this.read.write(chars, 0, len);
         assertMessages(FIRST, LAST);
-        assertEquals(FIRST + '\n' + LAST + '\n', read.toString());
+        assertEquals(FIRST + '\n' + LAST + '\n', this.read.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7f969fa7/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
index 0b2af3a..d55bf66 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
@@ -12,7 +12,7 @@ public class LoggerWriterFilterTest extends AbstractLoggerWriterTest {
 
     @Override
     protected Writer createWriterWrapper() {
-        return new LoggerWriterFilter(wrapped, getLogger(), LEVEL);
+        return new LoggerWriterFilter(this.wrapped, getLogger(), LEVEL);
     }
 
 }


[08/29] git commit: Refactor LoggerWriter into two classes: LoggerWriter and LoggerWriterFilter. The old LoggerWriter is like the new LoggerWriterFilter which subclasses WriterFilter. The idea behind the new LoggerWriter is that it does not need to carry

Posted by ma...@apache.org.
Refactor LoggerWriter into two classes: LoggerWriter and
LoggerWriterFilter. The old LoggerWriter is like the new
LoggerWriterFilter which subclasses WriterFilter. The idea behind the
new LoggerWriter is that it does not need to carry and write to another
wrapped Writer. This is what I'd want to do in JDBC for example.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3faca25d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3faca25d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3faca25d

Branch: refs/heads/LOG4J2-608
Commit: 3faca25d9b54691fb514bfbf373460e438ff5619
Parents: acba5dc
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Sep 2 10:10:45 2014 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Sep 2 10:10:45 2014 -0400

----------------------------------------------------------------------
 .../log4j/streams/LoggerPrintWriter.java        |  13 +-
 .../logging/log4j/streams/LoggerStreams.java    |   4 +-
 .../logging/log4j/streams/LoggerWriter.java     |  48 ++-----
 .../log4j/streams/LoggerWriterFilter.java       | 101 ++++++++++++++
 .../log4j/streams/AbstractLoggerWriterTest.java | 138 +++++++++++++++++++
 .../log4j/streams/AbstractStreamTest.java       |  59 ++++++++
 .../log4j/streams/LoggerInputStreamTest.java    |   2 +-
 .../log4j/streams/LoggerOutputStreamTest.java   |   2 +-
 .../log4j/streams/LoggerPrintWriterTest.java    |   9 +-
 .../logging/log4j/streams/LoggerReaderTest.java |   2 +-
 .../log4j/streams/LoggerWriterFilterTest.java   |  16 +++
 .../logging/log4j/streams/LoggerWriterTest.java | 118 +---------------
 .../logging/log4j/streams/StreamTesting.java    |  61 --------
 13 files changed, 349 insertions(+), 224 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
index f36c911..531a08b 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerPrintWriter.java
@@ -35,11 +35,11 @@ public class LoggerPrintWriter extends PrintWriter {
     private static final String FQCN = LoggerPrintWriter.class.getName();
 
     public LoggerPrintWriter(final Logger logger, final Level level) {
-        this(null, false, (ExtendedLogger) logger, FQCN, level, null);
+        this((ExtendedLogger) logger, false, FQCN, level, null);
     }
 
     public LoggerPrintWriter(final Logger logger, final Level level, final Marker marker) {
-        this(null, false, (ExtendedLogger) logger, FQCN, level, marker);
+        this((ExtendedLogger) logger, false, FQCN, level, marker);
     }
 
     public LoggerPrintWriter(final Writer writer, final Logger logger, final Level level) {
@@ -58,9 +58,16 @@ public class LoggerPrintWriter extends PrintWriter {
         this(writer, autoFlush, (ExtendedLogger) logger, FQCN, level, marker);
     }
 
+    @SuppressWarnings("resource")
     public LoggerPrintWriter(final Writer writer, final boolean autoFlush, final ExtendedLogger logger, final String fqcn,
             final Level level, final Marker marker) {
-        super(new LoggerWriter(writer, logger, fqcn, level, marker), autoFlush);
+        super(new LoggerWriterFilter(writer, logger, fqcn, level, marker), autoFlush);
+    }
+
+    @SuppressWarnings("resource")
+    public LoggerPrintWriter(final ExtendedLogger logger, final boolean autoFlush, final String fqcn,
+            final Level level, final Marker marker) {
+        super(new LoggerWriter(logger, fqcn, level, marker), autoFlush);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
index 1ad59d9..887cc4d 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerStreams.java
@@ -73,8 +73,8 @@ public class LoggerStreams {
             return new BufferedBuilder(logger, level, marker, 0);
         }
 
-        public LoggerWriter create(final Writer writer) {
-            return new LoggerWriter(writer, logger, level, marker);
+        public LoggerWriterFilter create(final Writer writer) {
+            return new LoggerWriterFilter(writer, logger, level, marker);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
index 30915d6..8233d64 100644
--- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriter.java
@@ -27,96 +27,64 @@ import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.streams.util.CharStreamLogger;
 
 /**
- * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker.
- * This class provides an interface that follows the {@link java.io.Writer} methods in spirit, but
- * doesn't require output to any external writer.
+ * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides
+ * an interface that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external
+ * writer.
  */
 public class LoggerWriter extends Writer {
     private static final String FQCN = LoggerWriter.class.getName();
 
-    private final Writer writer;
     private final CharStreamLogger logger;
     private final String fqcn;
 
-    public LoggerWriter(final Logger logger, final Level level) {
-        this(null, (ExtendedLogger) logger, FQCN, level, null);
-    }
-
     public LoggerWriter(final Logger logger, final Level level, final Marker marker) {
-        this(null, (ExtendedLogger) logger, FQCN, level, marker);
+        this((ExtendedLogger) logger, FQCN, level, marker);
     }
 
-    public LoggerWriter(final Writer writer, final Logger logger, final Level level) {
-        this(writer, (ExtendedLogger) logger, FQCN, level, null);
-    }
-
-    public LoggerWriter(final Writer writer, final Logger logger, final Level level, final Marker marker) {
-        this(writer, (ExtendedLogger) logger, FQCN, level, marker);
+    public LoggerWriter(final Logger logger, final Level level) {
+        this((ExtendedLogger) logger, FQCN, level, null);
     }
 
-    public LoggerWriter(final Writer writer, final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
-        this.writer = writer;
+    public LoggerWriter(final ExtendedLogger logger, final String fqcn, final Level level, final Marker marker) {
         this.logger = new CharStreamLogger(logger, level, marker);
         this.fqcn = fqcn;
     }
 
     @Override
     public void write(final int c) throws IOException {
-        if (writer != null) {
-            writer.write(c);
-        }
         logger.put(fqcn, (char) c);
     }
 
     @Override
     public void write(final char[] cbuf) throws IOException {
-        if (writer != null) {
-            writer.write(cbuf);
-        }
         logger.put(fqcn, cbuf, 0, cbuf.length);
     }
 
     @Override
     public void write(final char[] cbuf, final int off, final int len) throws IOException {
-        if (writer != null) {
-            writer.write(cbuf, off, len);
-        }
         logger.put(fqcn, cbuf, off, len);
     }
 
     @Override
     public void write(final String str) throws IOException {
-        if (writer != null) {
-            writer.write(str);
-        }
         logger.put(fqcn, str, 0, str.length());
     }
 
     @Override
     public void write(final String str, final int off, final int len) throws IOException {
-        if (writer != null) {
-            writer.write(str, off, len);
-        }
         logger.put(fqcn, str, off, len);
     }
 
     @Override
     public void flush() throws IOException {
-        if (writer != null) {
-            writer.flush();
-        }
     }
 
     @Override
     public void close() throws IOException {
-        if (writer != null) {
-            writer.close();
-        }
         logger.close(fqcn);
     }
 
-    @Override
     public String toString() {
-        return LoggerWriter.class.getSimpleName() + "{stream=" + writer + '}';
+        return this.getClass().getSimpleName() + "[fqcn=" + fqcn + ", logger=" + logger + "]";
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
new file mode 100644
index 0000000..9b7e3a0
--- /dev/null
+++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/LoggerWriterFilter.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.logging.log4j.streams;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.Marker;
+import org.apache.logging.log4j.spi.ExtendedLogger;
+import org.apache.logging.log4j.streams.util.CharStreamLogger;
+
+/**
+ * Writer that logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides
+ * an interface that follows the {@link java.io.Writer} methods in spirit, but doesn't require output to any external
+ * out.
+ */
+public class LoggerWriterFilter extends FilterWriter {
+    private static final String FQCN = LoggerWriterFilter.class.getName();
+
+    private final CharStreamLogger logger;
+    private final String fqcn;
+
+    public LoggerWriterFilter(final Writer out, final Logger logger, final Level level) {
+        this(out, (ExtendedLogger) logger, FQCN, level, null);
+    }
+
+    public LoggerWriterFilter(final Writer out, final Logger logger, final Level level, final Marker marker) {
+        this(out, (ExtendedLogger) logger, FQCN, level, marker);
+    }
+
+    public LoggerWriterFilter(final Writer out, final ExtendedLogger logger, final String fqcn, final Level level,
+            final Marker marker) {
+        super(out);
+        this.logger = new CharStreamLogger(logger, level, marker);
+        this.fqcn = fqcn;
+    }
+
+    @Override
+    public void write(final int c) throws IOException {
+        out.write(c);
+        logger.put(fqcn, (char) c);
+    }
+
+    @Override
+    public void write(final char[] cbuf) throws IOException {
+        out.write(cbuf);
+        logger.put(fqcn, cbuf, 0, cbuf.length);
+    }
+
+    @Override
+    public void write(final char[] cbuf, final int off, final int len) throws IOException {
+        out.write(cbuf, off, len);
+        logger.put(fqcn, cbuf, off, len);
+    }
+
+    @Override
+    public void write(final String str) throws IOException {
+        out.write(str);
+        logger.put(fqcn, str, 0, str.length());
+    }
+
+    @Override
+    public void write(final String str, final int off, final int len) throws IOException {
+        out.write(str, off, len);
+        logger.put(fqcn, str, off, len);
+    }
+
+    @Override
+    public void flush() throws IOException {
+        out.flush();
+    }
+
+    @Override
+    public void close() throws IOException {
+        out.close();
+        logger.close(fqcn);
+    }
+
+    @Override
+    public String toString() {
+        return LoggerWriterFilter.class.getSimpleName() + "{writer=" + out + '}';
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
new file mode 100644
index 0000000..5d727cb
--- /dev/null
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractLoggerWriterTest.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.logging.log4j.streams;
+
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.easymock.EasyMock;
+import org.junit.Before;
+import org.junit.Test;
+
+public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
+    protected StringWriter wrapped;
+    protected Writer writer;
+
+    @Before
+    public void createStream() {
+        wrapped = createWriter();
+        writer = createWriterWrapper();
+    }
+
+    protected abstract StringWriter createWriter();
+
+    protected abstract Writer createWriterWrapper();
+
+    @Test
+    public void testWrite_CharArray() throws Exception {
+        final char[] chars = FIRST.toCharArray();
+        writer.write(chars);
+        assertMessages();
+        writer.write('\n');
+        assertMessages(FIRST);
+        if (wrapped != null) {
+            assertEquals(FIRST + '\n', wrapped.toString());
+        }
+    }
+
+    @Test
+    public void testWrite_CharArray_Offset_Length() throws Exception {
+        final char[] chars = FIRST.toCharArray();
+        final int middle = chars.length / 2;
+        final int length = chars.length - middle;
+        final String right = new String(chars, middle, length);
+        writer.write(chars, middle, length);
+        assertMessages();
+        writer.write('\n');
+        assertMessages(right);
+        if (wrapped != null) {
+            assertEquals(FIRST.substring(middle, FIRST.length()) + '\n', wrapped.toString());
+        }
+    }
+
+    @Test
+    public void testWrite_Character() throws Exception {
+        for (final char c : FIRST.toCharArray()) {
+            writer.write(c);
+            assertMessages();
+        }
+        writer.write('\n');
+        assertMessages(FIRST);
+        if (wrapped != null) {
+            assertEquals(FIRST + '\n', wrapped.toString());
+        }
+    }
+
+    @Test
+    public void testWrite_IgnoresWindowsNewline() throws IOException {
+        writer.write(FIRST + "\r\n");
+        writer.write(LAST);
+        writer.close();
+        assertMessages(FIRST, LAST);
+        if (wrapped != null) {
+            assertEquals(FIRST + "\r\n" + LAST, wrapped.toString());
+        }
+    }
+
+    @Test
+    public void testWrite_MultipleLines() throws IOException {
+        writer.write(FIRST + '\n' + LAST + '\n');
+        assertMessages(FIRST, LAST);
+        if (wrapped != null) {
+            assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
+        }
+    }
+
+    @Test
+    public void testFlush() throws IOException {
+        final OutputStream out = EasyMock.createMock(OutputStream.class);
+        out.flush(); // expect the flush to come through to the mocked OutputStream
+        out.close();
+        replay(out);
+
+        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
+        los.flush();
+        los.close();
+        verify(out);
+    }
+
+    @Test
+    public void testClose_NoRemainingData() throws IOException {
+        writer.close();
+        assertMessages();
+        if (wrapped != null) {
+            assertEquals("", wrapped.toString());
+        }
+    }
+
+    @Test
+    public void testClose_HasRemainingData() throws IOException {
+        writer.write(FIRST);
+        assertMessages();
+        writer.close();
+        assertMessages(FIRST);
+        if (wrapped != null) {
+            assertEquals(FIRST, wrapped.toString());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
new file mode 100644
index 0000000..6422309
--- /dev/null
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/AbstractStreamTest.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.logging.log4j.streams;
+
+import static org.hamcrest.core.StringStartsWith.startsWith;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.Before;
+import org.junit.ClassRule;
+
+public abstract class AbstractStreamTest {
+    protected final static String NEWLINE = System.getProperty("line.separator");
+    protected final static Level LEVEL = Level.ERROR;
+    protected final static String FIRST = "first";
+    protected final static String LAST = "last";
+
+    @ClassRule
+    public static InitialLoggerContext ctx = new InitialLoggerContext("log4j2-streams-unit-test.xml");
+
+    protected static Logger getLogger() {
+        return ctx.getLogger("UnitTestLogger");
+    }
+
+    @Before
+    public void clearAppender() {
+        ((ListAppender) ctx.getAppender("UnitTest")).clear();
+    }
+
+    protected void assertMessages(final String... messages) {
+        final List<String> actualMsgs = ((ListAppender) ctx.getAppender("UnitTest")).getMessages();
+        assertEquals("Unexpected number of results.", messages.length, actualMsgs.size());
+        for (int i = 0; i < messages.length; i++) {
+            final String start = LEVEL.name() + ' ' + messages[i];
+            assertThat(actualMsgs.get(i), startsWith(start));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
index 3d11e02..09e5269 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerInputStreamTest.java
@@ -27,7 +27,7 @@ import java.io.InputStream;
 import org.junit.Before;
 import org.junit.Test;
 
-public class LoggerInputStreamTest extends StreamTesting {
+public class LoggerInputStreamTest extends AbstractStreamTest {
     protected ByteArrayInputStream wrapped;
     protected ByteArrayOutputStream read;
     protected InputStream in;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
index 21ebef1..4b9aa36 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerOutputStreamTest.java
@@ -29,7 +29,7 @@ import org.easymock.EasyMock;
 import org.junit.Before;
 import org.junit.Test;
 
-public class LoggerOutputStreamTest extends StreamTesting {
+public class LoggerOutputStreamTest extends AbstractStreamTest {
     protected ByteArrayOutputStream wrapped;
     protected OutputStream out;
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
index e46f840..7bc799c 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerPrintWriterTest.java
@@ -20,15 +20,20 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertSame;
 
 import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.io.Writer;
 
 import org.junit.Test;
 
-public class LoggerPrintWriterTest extends LoggerWriterTest {
+public class LoggerPrintWriterTest extends AbstractLoggerWriterTest {
     private PrintWriter print; 
 
+    protected StringWriter createWriter() {
+        return new StringWriter();
+    }
+
     @Override
-    protected Writer createWriter() {
+    protected Writer createWriterWrapper() {
         print = new LoggerPrintWriter(wrapped, getLogger(), LEVEL);
         return print;
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
index b41b9c6..8ac5ec9 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerReaderTest.java
@@ -28,7 +28,7 @@ import java.nio.CharBuffer;
 import org.junit.Before;
 import org.junit.Test;
 
-public class LoggerReaderTest extends StreamTesting {
+public class LoggerReaderTest extends AbstractStreamTest {
     protected StringReader wrapped;
     protected StringWriter read;
     protected Reader reader;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
new file mode 100644
index 0000000..c3aac1c
--- /dev/null
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterFilterTest.java
@@ -0,0 +1,16 @@
+package org.apache.logging.log4j.streams;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+public class LoggerWriterFilterTest extends AbstractLoggerWriterTest {
+
+    protected StringWriter createWriter() {
+        return new StringWriter();
+    }
+
+    protected Writer createWriterWrapper() {
+        return new LoggerWriterFilter(wrapped, getLogger(), LEVEL);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
index ea188af..b52e468 100644
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
+++ b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/LoggerWriterTest.java
@@ -1,124 +1,16 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 package org.apache.logging.log4j.streams;
 
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.io.OutputStream;
 import java.io.StringWriter;
 import java.io.Writer;
 
-import org.easymock.EasyMock;
-import org.junit.Before;
-import org.junit.Test;
-
-public class LoggerWriterTest extends StreamTesting {
-    protected StringWriter wrapped;
-    protected Writer writer;
-
-    @Before
-    public void createStream() {
-        wrapped = new StringWriter();
-        writer = createWriter();
-    }
-
-    protected Writer createWriter() {
-        return new LoggerWriter(wrapped, getLogger(), LEVEL);
-    }
-
-    @Test
-    public void testWrite_CharArray() throws Exception {
-        final char[] chars = FIRST.toCharArray();
-        writer.write(chars);
-        assertMessages();
-        writer.write('\n');
-        assertMessages(FIRST);
-        assertEquals(FIRST + '\n', wrapped.toString());
-    }
-
-    @Test
-    public void testWrite_CharArray_Offset_Length() throws Exception {
-        final char[] chars = FIRST.toCharArray();
-        final int middle = chars.length / 2;
-        final int length = chars.length - middle;
-        final String right = new String(chars, middle, length);
-        writer.write(chars, middle, length);
-        assertMessages();
-        writer.write('\n');
-        assertMessages(right);
-        assertEquals(FIRST.substring(middle, FIRST.length()) + '\n', wrapped.toString());
-    }
-
-    @Test
-    public void testWrite_Character() throws Exception {
-        for (final char c : FIRST.toCharArray()) {
-            writer.write(c);
-            assertMessages();
-        }
-        writer.write('\n');
-        assertMessages(FIRST);
-        assertEquals(FIRST + '\n', wrapped.toString());
-    }
+public class LoggerWriterTest extends AbstractLoggerWriterTest {
 
-    @Test
-    public void testWrite_IgnoresWindowsNewline() throws IOException {
-        writer.write(FIRST + "\r\n");
-        writer.write(LAST);
-        writer.close();
-        assertMessages(FIRST, LAST);
-        assertEquals(FIRST + "\r\n" + LAST, wrapped.toString());
+    protected StringWriter createWriter() {
+        return null;
     }
 
-    @Test
-    public void testWrite_MultipleLines() throws IOException {
-        writer.write(FIRST + '\n' + LAST + '\n');
-        assertMessages(FIRST, LAST);
-        assertEquals(FIRST + '\n' + LAST + '\n', wrapped.toString());
+    protected Writer createWriterWrapper() {
+        return new LoggerWriter(getLogger(), LEVEL);
     }
 
-    @Test
-    public void testFlush() throws IOException {
-        final OutputStream out = EasyMock.createMock(OutputStream.class);
-        out.flush(); // expect the flush to come through to the mocked OutputStream
-        out.close();
-        replay(out);
-
-        final LoggerOutputStream los = new LoggerOutputStream(out, getLogger(), LEVEL);
-        los.flush();
-        los.close();
-        verify(out);
-    }
-
-    @Test
-    public void testClose_NoRemainingData() throws IOException {
-        writer.close();
-        assertMessages();
-        assertEquals("", wrapped.toString());
-    }
-
-    @Test
-    public void testClose_HasRemainingData() throws IOException {
-        writer.write(FIRST);
-        assertMessages();
-        writer.close();
-        assertMessages(FIRST);
-        assertEquals(FIRST, wrapped.toString());
-    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3faca25d/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
----------------------------------------------------------------------
diff --git a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java b/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
deleted file mode 100644
index c2d9a61..0000000
--- a/log4j-streams/src/test/java/org/apache/logging/log4j/streams/StreamTesting.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.logging.log4j.streams;
-
-import static org.hamcrest.core.StringStartsWith.startsWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-
-@Ignore
-public class StreamTesting {
-    protected final static String NEWLINE = System.getProperty("line.separator");
-    protected final static Level LEVEL = Level.ERROR;
-    protected final static String FIRST = "first";
-    protected final static String LAST = "last";
-
-    @ClassRule
-    public static InitialLoggerContext ctx = new InitialLoggerContext("log4j2-streams-unit-test.xml");
-
-    protected static Logger getLogger() {
-        return ctx.getLogger("UnitTestLogger");
-    }
-
-    @Before
-    public void clearAppender() {
-        ((ListAppender) ctx.getAppender("UnitTest")).clear();
-    }
-
-    protected void assertMessages(final String... messages) {
-        final List<String> actualMsgs = ((ListAppender) ctx.getAppender("UnitTest")).getMessages();
-        assertEquals("Unexpected number of results.", messages.length, actualMsgs.size());
-        for (int i = 0; i < messages.length; i++) {
-            final String start = LEVEL.name() + ' ' + messages[i];
-            assertThat(actualMsgs.get(i), startsWith(start));
-        }
-    }
-}