You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2015/11/30 10:05:40 UTC

[20/50] logging-log4j2 git commit: LOG4J2-435 Delete documentation fixes

LOG4J2-435 Delete documentation fixes

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

Branch: refs/heads/LOG4J-1181
Commit: 4f0868c78e537bea48cfe7cd8fd75da4707443c5
Parents: ab15aef
Author: rpopma <rp...@apache.org>
Authored: Sat Nov 28 23:23:32 2015 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Nov 28 23:23:32 2015 +0900

----------------------------------------------------------------------
 src/site/xdoc/manual/appenders.xml | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4f0868c7/src/site/xdoc/manual/appenders.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/appenders.xml b/src/site/xdoc/manual/appenders.xml
index c291276..97ef344 100644
--- a/src/site/xdoc/manual/appenders.xml
+++ b/src/site/xdoc/manual/appenders.xml
@@ -2473,13 +2473,11 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           <a name="CustomDeleteOnRollover"/>
           <h5>Custom Delete on Rollover</h5>
           <p>
-            DefaultRolloverStrategy's <tt>max</tt> attribute only applies if the file pattern contains a <tt>%i</tt>
-            integer counter.
-          </p>
-          <p>
             Log4j-2.5 introduces a <tt>Delete</tt> action that gives users more control
-            over what files are deleted at rollover time.
-            The Delete action lets users configure one or more conditions that select the files to delete.
+            over what files are deleted at rollover time than what was possible with the DefaultRolloverStrategy
+            <tt>max</tt> attribute.
+            The Delete action lets users configure one or more conditions that select the files to delete
+            relative to a base directory.
             Note that it is possible to delete any file, not just rolled over log files, so use this action with care!
           </p>
           <table>
@@ -2659,7 +2657,8 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             Below is a sample configuration that uses a RollingFileAppender with the cron
             triggering policy configured to trigger every day at midnight.
             Archives are stored in a directory based on the current year and month.
-            Rolled over archives that are 60 days or older are deleted at rollover time.
+            All files that match the "*/app-*.log.gz" glob and are 60 days old
+            or older are deleted at rollover time.
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
@@ -2669,7 +2668,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
   </Properties>
   <Appenders>
     <RollingFile name="RollingFile" fileName="${baseDir}/app.log"
-                 filePattern="${baseDir}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd}.log.gz">
+          filePattern="${baseDir}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd}.log.gz">
       <PatternLayout pattern="%d %p %c{1.} [%t] %m%n" />
       <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
       <DefaultRolloverStrategy>
@@ -2703,7 +2702,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
   </Properties>
   <Appenders>
     <RollingFile name="RollingFile" fileName="${baseDir}/app.log"
-                 filePattern="${baseDir}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
+          filePattern="${baseDir}/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
       <PatternLayout pattern="%d %p %c{1.} [%t] %m%n" />
       <Policies>
         <TimeBasedTriggeringPolicy />
@@ -2712,6 +2711,8 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
       <DefaultRolloverStrategy max="100">
         <Delete basePath="${baseDir}" maxDepth="2">
           <IfFileName glob="*/app-*.log.gz">
+            <!-- nested: consider only the size of files that
+                 match the glob pattern, ignore other files -->
             <IfAccumulatedFileSize exceeds="100 GB" />
           </IfFileName>
         </Delete>