logbackloggly

Loggly logback appender is really slow


I'm using the Loggly logback appender as 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>

Everything is working as expected (logs appearing in Loggly) but it is incredibely slow, about 1 second per log message. It's bought my application all but to a halt. Is there a performance tweak i'm missing?


Solution

  • I've found the GitHub page for the LogglyAppender and used the LogglyBatchAppender instead of the one recommended by the Loggly doco. This seems to have solved the problem with long blocks writing the log message:

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