You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Peter Nimmervoll (JIRA)" <ji...@apache.org> on 2016/12/15 10:06:58 UTC
[jira] [Updated] (LOG4J2-1740) Add CronTriggeringPolicy
programmatically leads to NPE
[ https://issues.apache.org/jira/browse/LOG4J2-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Nimmervoll updated LOG4J2-1740:
-------------------------------------
Description:
When i try to add a RollingFileAppender with a CronTriggeringPolicy programmatically then I get a NPE because the ScheduledExecutorService in ConfigurationScheduler is null. IMO the ScheduledExecutorService should always be created even when there are no items which needs to be scheduled.
Caused by: java.lang.NullPointerException
at org.apache.logging.log4j.core.config.ConfigurationScheduler.schedule(ConfigurationScheduler.java:107) ~[log4j-core-2.7.jar:2.7]
at org.apache.logging.log4j.core.config.ConfigurationScheduler.scheduleWithCron(ConfigurationScheduler.java:120) ~[log4j-core-2.7.jar:2.7]
at org.apache.logging.log4j.core.appender.rolling.CronTriggeringPolicy.initialize(CronTriggeringPolicy.java:72) ~[log4j-core-2.7.jar:2.7]
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.initialize(RollingFileManager.java:104) ~[log4j-core-2.7.jar:2.7]
at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.createAppender(RollingRandomAccessFileAppender.java:218) ~[log4j-core-2.7.jar:2.7]
was:When i try to add a RollingFileAppender with a CronTriggeringPolicy programmatically then I get a NPE because the ScheduledExecutorService in ConfigurationScheduler is null. IMO the ScheduledExecutorService should always be created even when there are no items which needs to be scheduled.
> Add CronTriggeringPolicy programmatically leads to NPE
> ------------------------------------------------------
>
> Key: LOG4J2-1740
> URL: https://issues.apache.org/jira/browse/LOG4J2-1740
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.7
> Reporter: Peter Nimmervoll
>
> When i try to add a RollingFileAppender with a CronTriggeringPolicy programmatically then I get a NPE because the ScheduledExecutorService in ConfigurationScheduler is null. IMO the ScheduledExecutorService should always be created even when there are no items which needs to be scheduled.
> Caused by: java.lang.NullPointerException
> at org.apache.logging.log4j.core.config.ConfigurationScheduler.schedule(ConfigurationScheduler.java:107) ~[log4j-core-2.7.jar:2.7]
> at org.apache.logging.log4j.core.config.ConfigurationScheduler.scheduleWithCron(ConfigurationScheduler.java:120) ~[log4j-core-2.7.jar:2.7]
> at org.apache.logging.log4j.core.appender.rolling.CronTriggeringPolicy.initialize(CronTriggeringPolicy.java:72) ~[log4j-core-2.7.jar:2.7]
> at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.initialize(RollingFileManager.java:104) ~[log4j-core-2.7.jar:2.7]
> at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.createAppender(RollingRandomAccessFileAppender.java:218) ~[log4j-core-2.7.jar:2.7]
--
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