logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1855) Add an optional random delay in TimeBasedTriggeringPolicy
Date Sun, 02 Apr 2017 18:04:41 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15952794#comment-15952794
] 

ASF GitHub Bot commented on LOG4J2-1855:
----------------------------------------

Github user jvz commented on a diff in the pull request:

    https://github.com/apache/logging-log4j2/pull/68#discussion_r109315499
  
    --- Diff: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
---
    @@ -84,15 +91,18 @@ public boolean isTriggeringEvent(final LogEvent event) {
          * Creates a TimeBasedTriggeringPolicy.
          * @param interval The interval between rollovers.
          * @param modulate If true the time will be rounded to occur on a boundary aligned
with the increment.
    +     * @param maxRandomDelay If non-zero the rolling will be delayed by a random amount
of time, up to the specified value (in seconds)  
          * @return a TimeBasedTriggeringPolicy.
          */
         @PluginFactory
         public static TimeBasedTriggeringPolicy createPolicy(
                 @PluginAttribute("interval") final String interval,
    -            @PluginAttribute("modulate") final String modulate) {
    +            @PluginAttribute("modulate") final String modulate,
    +            @PluginAttribute("maxRandomDelay") final int maxRandomDelay) {
    --- End diff --
    
    Instead of adding a new param to the factory method, do you think you could convert this
to a builder and deprecate this method? This way, users who have used the factory method programmatically
will not have an API change break their config, and this way we can also use the type conversion
support to simplify the builder/factory as it is.


> Add an optional random delay in TimeBasedTriggeringPolicy
> ---------------------------------------------------------
>
>                 Key: LOG4J2-1855
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1855
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 2.8.1
>            Reporter: Anthony Maire
>
> When there are lots of JVM on the same physical host configured to rolling their log
file with a TimeBasedTriggeringPolicy, it will create a temporary load that can impact the
behavior of the applications since all JVM will roll and compress the old file at the same
time
> The purpose of this enhancement is to add an additional property on TimeBasedTriggeringPolicy
to delay the rolling by a random amount of time to avoid that massive simultaneous rolling.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message