logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1566216 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Date Sun, 09 Feb 2014 04:52:05 GMT
Author: rpopma
Date: Sun Feb  9 04:52:05 2014
New Revision: 1566216

URL: http://svn.apache.org/r1566216
Log:
LOG4J2-531: trace log purge() duration

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java?rev=1566216&r1=1566215&r2=1566216&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Sun Feb  9 04:52:05 2014
@@ -378,11 +378,15 @@ public class DefaultRolloverStrategy imp
         if (maxIndex < 0) {
             return null;
         }
+        long start = System.nanoTime();
         int fileIndex = purge(minIndex, maxIndex, manager);
         if (fileIndex < 0) {
             return null;
         }
-
+        if (LOGGER.isTraceEnabled()) {
+            double duration = (System.nanoTime() - start) / (1000.0 * 1000.0 * 1000.0);
+            LOGGER.trace("DefaultRolloverStrategy.purge() took {} seconds", duration);
+        }
         final StringBuilder buf = new StringBuilder(255);
         manager.getPatternProcessor().formatFileName(subst, buf, fileIndex);
         final String currentFileName = manager.getFileName();



Mime
View raw message