perf4j settings for logback.xml

喜你入骨 提交于 2019-12-01 00:31:55

The error message is very descriptive:

18:26:20,462 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [graphExecutionTimes]. Did you define it below in the config file?

[...]

18:26:20,506 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [graphExecutionTimes]

The error message explicitly asks you: Did you define [graphExecutionTimes] appender below in the config file? And in fact, this is the case, as shown above. Just switch these declarations:

<appender name="graphExecutionTimes" class="org.perf4j.logback.GraphingStatisticsAppender">
    <!-- Possible GraphTypes are Mean, Min, Max, StdDev, Count and TPS -->
    <param name="GraphType" value="Mean"/>
    <!-- The tags of the timed execution blocks to graph are specified here -->
    <param name="TagNamesToGraph" value="DESTROY_TICKET_GRANTING_TICKET,GRANT_SERVICE_TICKET,GRANT_PROXY_GRANTING_TICKET,VALIDATE_SERVICE_TICKET,CREATE_TICKET_GRANTING_TICKET" />
</appender>

<appender name="graphExecutionTPS" class="org.perf4j.logback.GraphingStatisticsAppender">
    <param name="GraphType" value="TPS" />
    <param name="TagNamesToGraph" value="DESTROY_TICKET_GRANTING_TICKET,GRANT_SERVICE_TICKET,GRANT_PROXY_GRANTING_TICKET,VALIDATE_SERVICE_TICKET,CREATE_TICKET_GRANTING_TICKET" />
</appender>

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

Just in case move perf4jFileAppender to the top as well. If this code snippet comes from Perf4J documentation, you should ask the authors to fix it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!