Is this property name already set in stone? Why not log4j2.
StatusLogger.DateFormat?

On 15 February 2018 at 21:59, <rpo...@apache.org> wrote:

> Repository: logging-log4j2
> Updated Branches:
>   refs/heads/release-2.x 8e803e788 -> 7588d3fd1
>
>
> LOG4J2-2250 The internal status logger timestamp format is now
> configurable with system property `log4j2.StatusLogger.dateformat`.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
> Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/
> commit/377570da
> Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/377570da
> Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/377570da
>
> Branch: refs/heads/release-2.x
> Commit: 377570dac80ab636745ee0fd937cde318db4acc8
> Parents: 8e803e7
> Author: rpopma <rpo...@apache.org>
> Authored: Fri Feb 16 12:58:17 2018 +0900
> Committer: rpopma <rpo...@apache.org>
> Committed: Fri Feb 16 12:58:17 2018 +0900
>
> ----------------------------------------------------------------------
>  .../logging/log4j/status/StatusLogger.java      | 10 ++++++-
>  src/site/xdoc/manual/configuration.xml.vm       | 28 +++++++++++++++++---
>  2 files changed, 34 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/
> 377570da/log4j-api/src/main/java/org/apache/logging/log4j/
> status/StatusLogger.java
> ----------------------------------------------------------------------
> diff --git 
> a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
> b/log4j-api/src/main/java/org/apache/logging/log4j/status/
> StatusLogger.java
> index 25e85ff..57da8f9 100644
> --- a/log4j-api/src/main/java/org/apache/logging/log4j/status/
> StatusLogger.java
> +++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/
> StatusLogger.java
> @@ -64,6 +64,13 @@ public final class StatusLogger extends AbstractLogger {
>       */
>      public static final String DEFAULT_STATUS_LISTENER_LEVEL =
> "log4j2.StatusLogger.level";
>
> +    /**
> +     * System property that can be configured with a date-time format
> string to use as the format for timestamps
> +     * in the status logger output. See {@link
> java.text.SimpleDateFormat} for supported formats.
> +     * @since 2.11.0
> +     */
> +    public static final String STATUS_DATE_FORMAT = "log4j2.StatusLogger.
> dateformat";
> +
>      private static final long serialVersionUID = 2L;
>
>      private static final String NOT_AVAIL = "?";
> @@ -96,7 +103,8 @@ public final class StatusLogger extends AbstractLogger {
>
>      private StatusLogger(final String name, final MessageFactory
> messageFactory) {
>          super(name, messageFactory);
> -        this.logger = new SimpleLogger("StatusLogger", Level.ERROR,
> false, true, false, false, Strings.EMPTY,
> +        this.logger = new SimpleLogger("StatusLogger", Level.ERROR,
> false, true, false, false,
> +                System.getProperty(STATUS_DATE_FORMAT, Strings.EMPTY),
>                  messageFactory, PROPS, System.err);
>          this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL,
> Level.WARN).intLevel();
>
>
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/
> 377570da/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 77c5f82..55b398d 100644
> --- a/src/site/xdoc/manual/configuration.xml.vm
> +++ b/src/site/xdoc/manual/configuration.xml.vm
> @@ -1623,7 +1623,17 @@ public class AwesomeTest {
>              column contains the name used in properties files and system
> properties; <i>Environemt Variable</i>
>              for the equivalent environment variable; and <i>Legacy
> Property Name</i> for the pre-2.10 name.
>            </p>
> -<table>
> +<style>
> +  * { // this works for all but td
> +  word-wrap:break-word;
> +  }
> +
> +  table { // this somehow makes it work for td
> +  table-layout:fixed;
> +  width:100%;
> +  }
> +</style>
> +<table style="table-layout: fixed; width: 100%">
>    <caption align="top">Log4j 2 global configuration properties</caption>
>    <tr>
>      <th>Property Name</th>
> @@ -1699,7 +1709,8 @@ public class AwesomeTest {
>      <td>org.apache.logging.log4j.simple .SimpleLoggerContextFactory</td>
>      <td>
>        Factory class used by LogManager to bootstrap the logging
> implementation.
> -      The core jar provides <tt>org.apache.logging.log4j.
> core.impl.Log4jContextFactory</tt>.
> +      The core jar provides <tt>org.apache.logging.log4j.core
> +      .impl.Log4jContextFactory</tt>.
>      </td>
>    </tr>
>    <tr>
> @@ -1708,7 +1719,8 @@ public class AwesomeTest {
>      <td><a name="log4j.configurationFactory"/>log4j.
> configurationFactory</td>
>      <td>&nbsp;</td>
>      <td>
> -      Fully specified class name of a class extending
> <tt>org.apache.logging.log4j.core.config.ConfigurationFactory</tt>.
> +      Fully specified class name of a class extending
> <tt>org.apache.logging.log4j.core
> +      .config.ConfigurationFactory</tt>.
>        If specified, an instance of this class is added to the list of
> configuration factories.
>      </td>
>    </tr>
> @@ -2023,6 +2035,16 @@ public class AwesomeTest {
>      </td>
>    </tr>
>    <tr>
> +    <td><a name="statusLoggerDateformat"/>log4j2.
> statusLoggerDateformat</td>
> +    <td>LOG4J_STATUS_LOGGER_DATEFORMAT</td>
> +    <td><a name="log4j2.StatusLogger.dateformat"/>log4j2.
> StatusLogger.dateformat</td>
> +    <td><code>"yyyy/MM/dd HH:mm:ss:SSS zzz"</code></td>
> +    <td>
> +      Date-time format string to use as the format for timestamps
> +      in the status logger output. See 
> <code>java.text.SimpleDateFormat</code>
> for supported formats.
> +    </td>
> +  </tr>
> +  <tr>
>      <td><a name="asyncLoggerExceptionHandler"/>log4j2.
> asyncLoggerExceptionHandler</td>
>      <td>LOG4J_ASYNC_LOGGER_EXCEPTION_HANDLER</td>
>      <td><a name="AsyncLogger.ExceptionHandler"/>
> AsyncLogger.ExceptionHandler</td>
>
>


-- 
Matt Sicker <boa...@gmail.com>

Reply via email to