Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
Description
I want to add an AsyncCoalescingStatisticsAppender. The XML confugration looks like this.
<appender name="CoalescingStatistics" class="org.perf4j.logback.AsyncCoalescingStatisticsAppender"> <param name="TimeSlice" value="60000"/> <appender-ref ref="graphExecutionTimes"/> <appender-ref ref="graphExecutionTPS"/> <!-- We add the JMX Appender reference onto the CoalescingStatistics --> <appender-ref ref="perf4jJmxAppender"/> </appender>
logback.groovy's appender function doesn't support <appender-ref ref="perf4jJmxAppender"/>.
The workaround is to write groovy directly:
JmxAttributeStatisticsAppender jmxAppender = new JmxAttributeStatisticsAppender() jmxAppender.name = "Per4j" jmxAppender.context = context jmxAppender.tagNamesToExpose="tag1, tag2" appenderList.add(jmxAppender) AsyncCoalescingStatisticsAppender coalAppender = new AsyncCoalescingStatisticsAppender() // in millisecond coalAppender.timeSlice=10000 coalAppender.name = "CoalescingStatistics" coalAppender.context = context coalAppender.addAppender(jmxAppender) appenderList.add(coalAppender)