Discussion:
[jira] [Created] (LOG4J2-821) CompositeTriggeringPolicy behavior
Hassan Kalaldeh (JIRA)
2014-09-10 12:03:28 UTC
Permalink
Hassan Kalaldeh created LOG4J2-821:
--------------------------------------

Summary: CompositeTriggeringPolicy behavior
Key: LOG4J2-821
URL: https://issues.apache.org/jira/browse/LOG4J2-821
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.0.2
Reporter: Hassan Kalaldeh


referring to "Composite Triggering Policy" section under http://logging.apache.org/log4j/2.x/manual/appenders.html

"Composite Triggering Policy
The CompositeTriggeringPolicy combines multiple triggering policies and returns true if any of the configured policies return true. The CompositeTriggeringPolicy is configured simply by wrapping other policies in a Policies element."

Shouldn't be the opposite, CompositeTriggeringPolicy returns true only of all children triggering policies are met ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Ralph Goers (JIRA)
2014-09-11 02:55:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129553#comment-14129553 ]

Ralph Goers commented on LOG4J2-821:
------------------------------------

In short, no. If you configure a size-based trigger or a time-based trigger you want the rollover to happen when one of them occurs, not both. That said, it should be possible to add an attribute to the CompositeTriggeringPolicy to indicate whether it should perform an and or an or.
Post by Hassan Kalaldeh (JIRA)
CompositeTriggeringPolicy behavior
----------------------------------
Key: LOG4J2-821
URL: https://issues.apache.org/jira/browse/LOG4J2-821
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.0.2
Reporter: Hassan Kalaldeh
referring to "Composite Triggering Policy" section under http://logging.apache.org/log4j/2.x/manual/appenders.html
"Composite Triggering Policy
The CompositeTriggeringPolicy combines multiple triggering policies and returns true if any of the configured policies return true. The CompositeTriggeringPolicy is configured simply by wrapping other policies in a Policies element."
Shouldn't be the opposite, CompositeTriggeringPolicy returns true only of all children triggering policies are met ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Hassan Kalaldeh (JIRA)
2014-09-23 08:34:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144547#comment-14144547 ]

Hassan Kalaldeh commented on LOG4J2-821:
----------------------------------------

Thanks [~***@dslextreme.com], can you please tell me then what's is wrong in the following appender ? the expected behavior is that it should archive log when file size reaches 20 GB OR after one minute, but when I tested it only archives log after reaching 20 GB after passing more than 6 minutes!

{code}
<RollingFile name="MainRollingFile" fileName="logs/main.log" filePattern="logs/$${date:yyyy/MM/dd/mm}/main-%d{yyyy-MM-dd-mm}-%i.log.gz"
append="true" immediateFlush="false">
<PatternLayout>
<Pattern>%d{ISO8601}: %-5p [%-8t] [%C{1}.%M():%L] - %m%n</Pattern>
</PatternLayout>
<Policies>
<CompositeTriggeringiPolicy>
<SizeBasedTriggeringPolicy size="20 GB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<OnStartupTriggeringPolicy />
</CompositeTriggeringiPolicy>
</Policies>
<DefaultRolloverStrategy max="10"/>
</RollingFile>
{code}
Post by Hassan Kalaldeh (JIRA)
CompositeTriggeringPolicy behavior
----------------------------------
Key: LOG4J2-821
URL: https://issues.apache.org/jira/browse/LOG4J2-821
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.0.2
Reporter: Hassan Kalaldeh
referring to "Composite Triggering Policy" section under http://logging.apache.org/log4j/2.x/manual/appenders.html
"Composite Triggering Policy
The CompositeTriggeringPolicy combines multiple triggering policies and returns true if any of the configured policies return true. The CompositeTriggeringPolicy is configured simply by wrapping other policies in a Policies element."
Shouldn't be the opposite, CompositeTriggeringPolicy returns true only of all children triggering policies are met ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Hassan Kalaldeh (JIRA)
2014-09-23 08:52:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144547#comment-14144547 ]

Hassan Kalaldeh edited comment on LOG4J2-821 at 9/23/14 8:52 AM:
-----------------------------------------------------------------

Thanks [~***@dslextreme.com], can you please tell me then what's is wrong in the following appender ? the expected behavior is that it should archive log every minute OR when file size reaches 20 GB (and of course when system starts and find log), but when I tested it only archives log after reaching 20 GB after passing more than 6 minutes!

{code}
<RollingFile name="MainRollingFile" fileName="logs/main.log" filePattern="logs/$${date:yyyy/MM/dd/mm}/main-%d{yyyy-MM-dd-mm}-%i.log.gz"
append="true" immediateFlush="false">
<PatternLayout>
<Pattern>%d{ISO8601}: %-5p [%-8t] [%C{1}.%M():%L] - %m%n</Pattern>
</PatternLayout>
<Policies>
<CompositeTriggeringiPolicy>
<SizeBasedTriggeringPolicy size="20 GB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<OnStartupTriggeringPolicy />
</CompositeTriggeringiPolicy>
</Policies>
<DefaultRolloverStrategy max="10"/>
</RollingFile>
{code}



was (Author: hassan.kalaldeh):
Thanks [~***@dslextreme.com], can you please tell me then what's is wrong in the following appender ? the expected behavior is that it should archive log when file size reaches 20 GB OR after one minute, but when I tested it only archives log after reaching 20 GB after passing more than 6 minutes!

{code}
<RollingFile name="MainRollingFile" fileName="logs/main.log" filePattern="logs/$${date:yyyy/MM/dd/mm}/main-%d{yyyy-MM-dd-mm}-%i.log.gz"
append="true" immediateFlush="false">
<PatternLayout>
<Pattern>%d{ISO8601}: %-5p [%-8t] [%C{1}.%M():%L] - %m%n</Pattern>
</PatternLayout>
<Policies>
<CompositeTriggeringiPolicy>
<SizeBasedTriggeringPolicy size="20 GB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
<OnStartupTriggeringPolicy />
</CompositeTriggeringiPolicy>
</Policies>
<DefaultRolloverStrategy max="10"/>
</RollingFile>
{code}
Post by Hassan Kalaldeh (JIRA)
CompositeTriggeringPolicy behavior
----------------------------------
Key: LOG4J2-821
URL: https://issues.apache.org/jira/browse/LOG4J2-821
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.0.2
Reporter: Hassan Kalaldeh
referring to "Composite Triggering Policy" section under http://logging.apache.org/log4j/2.x/manual/appenders.html
"Composite Triggering Policy
The CompositeTriggeringPolicy combines multiple triggering policies and returns true if any of the configured policies return true. The CompositeTriggeringPolicy is configured simply by wrapping other policies in a Policies element."
Shouldn't be the opposite, CompositeTriggeringPolicy returns true only of all children triggering policies are met ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Hassan Kalaldeh (JIRA)
2014-09-23 09:30:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14144603#comment-14144603 ]

Hassan Kalaldeh commented on LOG4J2-821:
----------------------------------------

BTW in the example from previous comment, when I remove <CompositeTriggeringiPolicy> element, it works as expected where it archives log very minute OR if file size reaches 20 GB before passing a minute.
Post by Hassan Kalaldeh (JIRA)
CompositeTriggeringPolicy behavior
----------------------------------
Key: LOG4J2-821
URL: https://issues.apache.org/jira/browse/LOG4J2-821
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.0.2
Reporter: Hassan Kalaldeh
referring to "Composite Triggering Policy" section under http://logging.apache.org/log4j/2.x/manual/appenders.html
"Composite Triggering Policy
The CompositeTriggeringPolicy combines multiple triggering policies and returns true if any of the configured policies return true. The CompositeTriggeringPolicy is configured simply by wrapping other policies in a Policies element."
Shouldn't be the opposite, CompositeTriggeringPolicy returns true only of all children triggering policies are met ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Loading...