@@ -0,0 +1,2658 @@
+package net.kencochrane.raven.jul;%0A%0Aimport net.kencochrane.raven.Raven;%0Aimport net.kencochrane.raven.event.EventBuilder;%0Aimport net.kencochrane.raven.event.LoggedEvent;%0Aimport net.kencochrane.raven.event.interfaces.ExceptionInterface;%0Aimport net.kencochrane.raven.event.interfaces.MessageInterface;%0Aimport net.kencochrane.raven.event.interfaces.StackTraceInterface;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Date;%0Aimport java.util.List;%0Aimport java.util.logging.Handler;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.LogRecord;%0A%0Apublic class SentryHandler extends Handler %7B%0A    private final Raven raven;%0A%0A    public SentryHandler() %7B%0A        this(new Raven());%0A    %7D%0A%0A    public SentryHandler(Raven raven) %7B%0A        this.raven = raven;%0A    %7D%0A%0A    private static LoggedEvent.Level getLevel(Level level) %7B%0A        if (level.intValue() %3E= Level.SEVERE.intValue())%0A            return LoggedEvent.Level.ERROR;%0A        else if (level.intValue() %3E= Level.WARNING.intValue())%0A            return LoggedEvent.Level.WARNING;%0A        else if (level.intValue() %3E= Level.INFO.intValue())%0A            return LoggedEvent.Level.INFO;%0A        else if (level.intValue() %3E= Level.ALL.intValue())%0A            return LoggedEvent.Level.DEBUG;%0A        else return null;%0A    %7D%0A%0A    private static List%3CString%3E formatParameters(Object%5B%5D parameters) %7B%0A        List%3CString%3E formattedParameters = new ArrayList%3CString%3E(parameters.length);%0A        for (Object parameter : parameters)%0A            formattedParameters.add(parameter.toString());%0A        return formattedParameters;%0A    %7D%0A%0A    @Override%0A    public void publish(LogRecord record) %7B%0A        if (!isLoggable(record)) %7B%0A            return;%0A        %7D%0A%0A        EventBuilder eventBuilder = new EventBuilder()%0A                .setLevel(getLevel(record.getLevel()))%0A                .setTimestamp(new Date(record.getMillis()))%0A                .setLogger(record.getLoggerName())%0A                .setCulprit(record.getSourceClassName() + %22.%22 + record.getSourceMethodName() + %22()%22);%0A        if (record.getThrown() != null) %7B%0A            eventBuilder.addSentryInterface(new ExceptionInterface(record.getThrown()))%0A                    .addSentryInterface(new StackTraceInterface(record.getThrown()));%0A        %7D%0A%0A        if (record.getParameters() != null)%0A            eventBuilder.addSentryInterface(new MessageInterface(record.getMessage(), formatParameters(record.getParameters())));%0A        else%0A            eventBuilder.setMessage(record.getMessage());%0A%0A        raven.sendEvent(eventBuilder);%0A    %7D%0A%0A    @Override%0A    public void flush() %7B%0A    %7D%0A%0A    @Override%0A    public void close() throws SecurityException %7B%0A    %7D%0A%7D%0A

Create a JUL handler using Raven