An appender for Hoptoad which works with LOGBack
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

HoptoadAppender for LOGBack

This HoptoadAppender is for use with LOGBack ( to log errors and warnings to the Hoptoad ( application. It uses the excellent Databinder Dispatch library for doing asynchronous HTTP calls to the Hoptoad application.


It's recommended that you configure the HoptoadAppender with a Filter that will limit logging messages to the ERROR level only.

  <appender name="HOPTOAD" class="">
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
    <apiKey><!-- INSERT HOPTOAD API KEY HERE --></apiKey>
    <secure>false</secure> <!-- Change to true if you are using HTTPS for Hoptoad -->

  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        %-4relative [%thread] %-5level %logger{30} - %msg%n

  <root level="DEBUG">
    <appender-ref ref="HOPTOAD" />
    <appender-ref ref="CONSOLE" />

MDC (Mapped Diagnostic Context)

For several logging variables, the HoptoadAppender uses MDC to provide the appropriate varaibles to include in the Hoptoad notice. These should be configured using a filter or some other way of injecting the variables into the MDC of the thread.

The following variables are required in the MDC:


The following variables are optional:


If the REQUEST_URL is specified, then the following can also be set:

  • (required)

The REQUEST_PARAMS, SESSION_PARAMS and CGI_PARAMS should be ampersand delimited, URL encoded key/value pairs.

Because the above static variables are declared in Scala, you'll have to set them like this if you are using Java:

import org.slf4j.MDC;

MDC.setProperty(, "production")

If you don't like the extra parens that you have to use, then you should be using Scala instead of Java :-)


slf4j-hoptoad is released under the Apache 2 License.