logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1084050 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender: FileAppender.java RollingFileAppender.java
Date Tue, 22 Mar 2011 02:03:29 GMT
Author: rgoers
Date: Tue Mar 22 02:03:28 2011
New Revision: 1084050

URL: http://svn.apache.org/viewvc?rev=1084050&view=rev
Log:
Only log warning if value was not defaulted. Allow immediate flush even on buffered streams

Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java?rev=1084050&r1=1084049&r2=1084050&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
Tue Mar 22 02:03:28 2011
@@ -56,17 +56,13 @@ public class FileAppender extends Output
         boolean isAppend = append == null ? true : Boolean.valueOf(append);
         boolean isLocking = locking == null ? false : Boolean.valueOf(locking);
         boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);;
-        if (isLocking) {
-            logger.warn("Locking and buffering are mutually exclusive. No buffereing will
occur for " + fileName);
+        if (isLocking && isBuffered) {
+            if (bufferedIO != null) {
+                logger.warn("Locking and buffering are mutually exclusive. No buffereing
will occur for " + fileName);
+            }
             isBuffered = false;
         }
         boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
-        if (isBuffered) {
-            logger.warn("Immediate flush and buffering are mutually exclusive. Imeddiate
flush will not occur for " +
-                fileName);
-            isFlush = false;
-        }
-
         boolean handleExceptions = locking == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java?rev=1084050&r1=1084049&r2=1084050&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
(original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
Tue Mar 22 02:03:28 2011
@@ -101,11 +101,7 @@ public class RollingFileAppender extends
         boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
         boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);;
         boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);;
-        if (isBuffered) {
-            logger.warn("Immediate flush and buffering are mutually exclusive. Immediate
flush will not occur for appender " +
-                 name);
-            isFlush = false;
-        }
+
         CompressionType type = CompressionType.NONE;
 
         if (name == null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message