You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Tapan Choudhury (JIRA)" <ji...@apache.org> on 2017/04/26 21:09:04 UTC
[jira] [Created] (LOG4J2-1891) Creating Custom TriggeringPolicy
Tapan Choudhury created LOG4J2-1891:
---------------------------------------
Summary: 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
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 "RecordCountBasedTriggeringPolicy".
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)