Repository: logging-log4j2 Updated Branches: refs/heads/master b46ee7434 -> f6bd93ce9
Specify seconds in attribute name (add alias for backward compatibility). Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f6bd93ce Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f6bd93ce Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f6bd93ce Branch: refs/heads/master Commit: f6bd93ce9a25313164d1ef2634fdbfb8a9200a27 Parents: b46ee74 Author: Gary Gregory <[email protected]> Authored: Fri Oct 3 19:01:30 2014 -0400 Committer: Gary Gregory <[email protected]> Committed: Fri Oct 3 19:01:30 2014 -0400 ---------------------------------------------------------------------- .../logging/log4j/core/appender/FailoverAppender.java | 10 ++++++---- src/site/xdoc/manual/appenders.xml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f6bd93ce/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java index c460964..9629a29 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java @@ -27,6 +27,7 @@ import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.config.AppenderControl; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginAliases; import org.apache.logging.log4j.core.config.plugins.PluginAttribute; import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; import org.apache.logging.log4j.core.config.plugins.PluginElement; @@ -170,7 +171,7 @@ public final class FailoverAppender extends AbstractAppender { * @param name The name of the Appender (required). * @param primary The name of the primary Appender (required). * @param failovers The name of one or more Appenders to fail over to (at least one is required). - * @param retryIntervalString The retry intervalMillis. + * @param retryIntervalSeconds The retry intervalMillis. * @param config The current Configuration (passed by the Configuration when the appender is created). * @param filter A Filter (optional). * @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise @@ -182,7 +183,8 @@ public final class FailoverAppender extends AbstractAppender { @PluginAttribute("name") final String name, @PluginAttribute("primary") final String primary, @PluginElement("Failovers") final String[] failovers, - @PluginAttribute("retryInterval") final String retryIntervalString, + @PluginAliases("retryInterval") // deprecated + @PluginAttribute("retryIntervalSeconds") final String retryIntervalSeconds, @PluginConfiguration final Configuration config, @PluginElement("Filter") final Filter filter, @PluginAttribute("ignoreExceptions") final String ignore) { @@ -199,12 +201,12 @@ public final class FailoverAppender extends AbstractAppender { return null; } - final int seconds = parseInt(retryIntervalString, DEFAULT_INTERVAL_SECONDS); + final int seconds = parseInt(retryIntervalSeconds, DEFAULT_INTERVAL_SECONDS); int retryIntervalMillis; if (seconds >= 0) { retryIntervalMillis = seconds * Constants.MILLIS_IN_SECONDS; } else { - LOGGER.warn("Interval " + retryIntervalString + " is less than zero. Using default"); + LOGGER.warn("Interval " + retryIntervalSeconds + " is less than zero. Using default"); retryIntervalMillis = DEFAULT_INTERVAL_SECONDS * Constants.MILLIS_IN_SECONDS; } http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f6bd93ce/src/site/xdoc/manual/appenders.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/manual/appenders.xml b/src/site/xdoc/manual/appenders.xml index c10e7ef..fe203c4 100644 --- a/src/site/xdoc/manual/appenders.xml +++ b/src/site/xdoc/manual/appenders.xml @@ -239,7 +239,7 @@ <td>The name of the Appender.</td> </tr> <tr> - <td>retryInterval</td> + <td>retryIntervalSeconds</td> <td>integer</td> <td>The number of seconds that should pass before retrying the primary Appender. The default is 60.</td> </tr>
