perf4j settings for logback.xml

前端 未结 1 1329
北恋
北恋 2021-01-07 07:43

hi folks I want to know exact config settings of logback.xml when it was using with perf4j. i create this configuration in logback.xml



        
相关标签:
1条回答
  • 2021-01-07 08:18

    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.

    0 讨论(0)
提交回复
热议问题