logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1548) [CronTriggeringPolicy] ConfigurationScheduler schedules the task infinitely after first fire
Date Wed, 24 Aug 2016 15:35:20 GMT

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

Gary Gregory commented on LOG4J2-1548:
--------------------------------------

Hello Pierrick,

I am testing the patch locally BUT I am not applying this part which does not seem to be needed
to make the test pass:

{noformat}
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
index 14bf1e8..898b321 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
@@ -201,7 +201,11 @@ public class ResolverUtil {
                 } else if (VFS.equals(url.getProtocol())) {
                     final String path = urlPath.substring(1, urlPath.length() - packageName.length()
- 2);
                     final File file = new File(path);
-                    loadImplementationsInJar(test, packageName, file);
+                    if (file.isDirectory()) {
+                        loadImplementationsInDirectory(test, null, file);
+                    } else {
+                        loadImplementationsInJar(test, packageName, file);
+                    }
                 } else if (BUNDLE_RESOURCE.equals(url.getProtocol())) {
                     loadImplementationsInBundle(test, packageName);
                 } else {
{noformat}

Please create a separate ticket and test if possible.

> [CronTriggeringPolicy] ConfigurationScheduler schedules the task infinitely after first
fire
> --------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1548
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1548
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.6.2
>            Reporter: Pierrick HYMBERT
>            Priority: Blocker
>         Attachments: LOG4J2-1548-testcase.patch, LOG4J2-1548.patch
>
>
> After first fire at fixed time, rename/archive action is sheduled infinitely.
> Example of configuration:
> {code:xml}
> <RollingFile name="RollingFile"
>     	 fileName="target/rolling-cron-once-a-day/rollingtest.log"
>     	 filePattern="target/rolling-cron-once-a-day/rollingtest-%d{yyyyMMdd}_%d{HHmmss}-%i.log.gz"
>     	 immediateFlush="true">
>       <PatternLayout pattern="%d %p %C{1.} [%t] %m%n" />
>       <CronTriggeringPolicy schedule="27 58 13 * * ?"/>
>     </RollingFile>
> {code}
> First trigger is scheduled at 13:58:27 then every new log entry generates an archive
file.
> Test case and suggested fix attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
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