LOG4J2-1623 Update documentation
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5564556c Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5564556c Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5564556c Branch: refs/heads/master Commit: 5564556cd81be70926d6f35a2ff323f623728f5a Parents: 9446525 Author: Mikael Ståldal <mikael.stal...@magine.com> Authored: Wed Oct 5 13:35:41 2016 +0200 Committer: Mikael Ståldal <mikael.stal...@magine.com> Committed: Wed Oct 5 13:35:41 2016 +0200 ---------------------------------------------------------------------- .../org/apache/logging/log4j/core/LoggerContext.java | 12 ++++++++++++ src/site/xdoc/manual/configuration.xml.vm | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5564556c/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java index c964965..2681485 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java @@ -302,6 +302,18 @@ public class LoggerContext extends AbstractLifeCycle stop(); } + /** + * How many milliseconds appenders and other plugins will get to shutdown. + * + * Not all plugins will honor this, it is a hint and not an absolute guarantee that the this method not block longer. + * Setting timeout too low increase the risk of losing outstanding log events not yet written to the final + * destination. + * + * @param timeout the maximum time to wait, or 0 which mean that each plugin uses its default timeout + * @param timeUnit the time unit of the timeout argument + * @return true if the context was stopped cleanly and normally, false otherwise. + * @since 2.7 + */ @Override public boolean stop(final long timeout, final TimeUnit timeUnit) { LOGGER.debug("Stopping LoggerContext[name={}, {}]...", getName(), this); http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5564556c/src/site/xdoc/manual/configuration.xml.vm ---------------------------------------------------------------------- diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm index acd41fd..2b59e8d 100644 --- a/src/site/xdoc/manual/configuration.xml.vm +++ b/src/site/xdoc/manual/configuration.xml.vm @@ -409,8 +409,13 @@ public class Bar { </tr> <tr> <td>shutdownTimeout</td> - <td>Specifies how many milliseconds appenders and other plugins will get to shutdown when the JVM shuts down. - Default is zero. (Not used if <tt>shutdownHook</tt> is set to "disable".)</td> + <td>Specifies how many milliseconds appenders and other plugins will get to shutdown when the JVM shuts + down. Default is zero which mean that each plugin uses its default timeout. Not all plugins will honor + this, it is a hint and not an absolute guarantee that the shutdown procedure will not take longer. + Setting this too low increase the risk of losing outstanding log events not yet written to the final + destination. See <a class="javadoc" + href="../log4j-core/target/site/apidocs/org/apache/logging/log4j/core/LoggerContext.html#stop(long, java.util.concurrent.TimeUnit)">LoggerContext.stop(long, java.util.concurrent.TimeUnit)</a>. + (Not used if <tt>shutdownHook</tt> is set to "disable".)</td> <tr> <td>status</td> <td>The level of internal Log4j events that should be logged to the console.