public static void logException(RakamHttpRequest request, Throwable e) { if (RAVEN == null) { return; } EventBuilder builder = new EventBuilder() .withSentryInterface(new ExceptionInterface(e)) .withSentryInterface(new HttpInterface(new RakamServletWrapper(request))) .withLevel(Event.Level.WARNING) .withLogger(RakamException.class.getName()); if (TAGS != null) { for (Map.Entry<String, String> entry : TAGS.entrySet()) { builder.withTag(entry.getKey(), entry.getValue()); } } if (RELEASE != null) { builder.withRelease(RELEASE); } RAVEN.sendEvent(builder.build()); }
public static void logException(RakamHttpRequest request, RakamException e) { if (RAVEN == null) { return; } EventBuilder builder = new EventBuilder() .withMessage(e.getMessage()) .withSentryInterface(new HttpInterface(new RakamServletWrapper(request))) .withLevel(Event.Level.ERROR) .withLogger(RakamException.class.getName()) .withTag("status", e.getStatusCode().reasonPhrase()); if (TAGS != null) { for (Map.Entry<String, String> entry : TAGS.entrySet()) { builder.withTag(entry.getKey(), entry.getValue()); } } if (RELEASE != null) { builder.withRelease(RELEASE); } RAVEN.sendEvent(builder.build()); }
private void addHttpInterface(EventBuilder eventBuilder, HttpServletRequest servletRequest) { eventBuilder.withSentryInterface(new HttpInterface(servletRequest, remoteAddressResolver), false); }