[
https://issues.apache.org/jira/browse/LOG4J2-1891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15985624#comment-15985624
]
Matt Sicker commented on LOG4J2-1891:
-------------------------------------
How are you building this? Via Maven/Gradle/something, or an IDE? If from an
IDE, you need to enable annotation processing which is typically disabled by
default (even though javac, maven, gradle, etc., enable it by default).
> Creating Custom TriggeringPolicy
> --------------------------------
>
> Key: LOG4J2-1891
> URL: https://issues.apache.org/jira/browse/LOG4J2-1891
> Project: Log4j 2
> Issue Type: Question
> Components: Core
> Affects Versions: 2.0.2
> Reporter: Tapan Choudhury
> Attachments: Logfile.log, RecordCountBasedTriggeringPolicy.java
>
>
> I want log files to be rolled over on every 20000 log entries. For this, I am
> trying to create a Custom TriggeringPolicy which implements TriggeringPolicy
> with Annotation of @Plugin(name = "NewTriggeringPolicy", category = "Core",
> printObject = true).
> I have annotated method createPolicy with @PluginFactory.
> Also updated my pom file with the plugin as suggested @
> http://logging.apache.org/log4j/2.x/manual/plugins.html.
> In my log4j configuration file, when I mention something as below:
> <Policies>
> < NewTriggeringPolicy recordCount="200"/>
> </Policies>
> I am getting error as ERROR Policies contains an invalid element or attribute
> "NewTriggeringPolicy".
> Please let me know what wrong I am doing here or if there is a better way to
> do this.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)