Loggly logback appender非常慢

时间:2017-06-12 21:47:51

标签: logback loggly

我正在使用Loggly logback appender作为detailed in their setup guide

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <appender name="LOGGLY" class="ch.qos.logback.ext.loggly.LogglyAppender">
        <endpointUrl>https://logs-01.loggly.com/inputs/MY_TOKEN/tag/logback</endpointUrl>
        <pattern>%d{"ISO8601", UTC}  %p %t %c %M - %m%n</pattern>
    </appender>

    <root level="INFO">
        <appender-ref ref="LOGGLY" />
    </root>

</configuration>

一切都按预期工作(日志出现在Loggly中),但它非常慢,每条日志消息大约1秒。它买了我的应用程序,但停了下来。我是否缺少性能调整?

2 个答案:

答案 0 :(得分:4)

我找到了LogglyAppender的{​​{3}}并使用了LogglyBatchAppender而不是Loggly doco推荐的<appender name="LOGGLY" class="ch.qos.logback.ext.loggly.LogglyBatchAppender"> <endpointUrl>https://logs-01.loggly.com/bulk/MY_TOKEN/tag/admin</endpointUrl> <pattern>%d{"ISO8601", UTC} %p %t %c %M - %m%n</pattern> <flushIntervalInSeconds>2</flushIntervalInSeconds> </appender> 。这似乎解决了写入日志消息的长块的问题:

android:weightSum="3"

答案 1 :(得分:0)