Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Simple dropwizard integration for
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.Layout;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.tapstream.rollbar.RollbarAppender;
import io.dropwizard.logging.AbstractAppenderFactory;
import javax.validation.constraints.NotNull;
public class RollbarAppenderFactory extends AbstractAppenderFactory {
private String environment = "development";
private String apiKey;
public String getEnvironment() {
return environment;
public void setEnvironment(String environment) {
this.environment = environment;
public String getApiKey() {
return apiKey;
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
public Appender<ILoggingEvent> build(LoggerContext context, String applicationName, Layout<ILoggingEvent> layout) {
final RollbarAppender appender = new RollbarAppender();
return wrapAsync(appender);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment