code: protected EventBuilder createEventBuilder(LogEvent event) {
          Message eventMessage = event.getMessage();
          EventBuilder eventBuilder = new EventBuilder()
              .withSdkIntegration("log4j2")
              .withTimestamp(new Date(event.getTimeMillis()))
              .withMessage(eventMessage.getFormattedMessage())
              .withLogger(event.getLoggerName())
              .withLevel(formatLevel(event.getLevel()))
              .withExtra(THREAD_NAME, event.getThreadName());
  
          if (eventMessage.getFormat() != null
              && !eventMessage.getFormat().equals("")
              && !eventMessage.getFormattedMessage().equals(eventMessage.getFormat())) {
              eventBuilder.withSentryInterface(new MessageInterface(
                  eventMessage.getFormat(),
                  formatMessageParameters(eventMessage.getParameters()),
                  eventMessage.getFormattedMessage()));
          }
  
          Throwable throwable = event.getThrown();
          if (throwable != null) {
              eventBuilder.withSentryInterface(new ExceptionInterface(throwable));
          } else if (event.getSource() != null) {
              StackTraceElement[] stackTrace = {event.getSource()};
              eventBuilder.withSentryInterface(new StackTraceInterface(stackTrace));
          }
  
          if (event.getContextStack() != null) {
              eventBuilder.withExtra(LOG4J_NDC, event.getContextStack().asList());
          }
  
          if (event.getContextMap() != null) {
              for (Map.Entry<String, String> contextEntry : event.getContextMap().entrySet()) {
                  if (Sentry.getStoredClient().getMdcTags().contains(contextEntry.getKey())) {
                      eventBuilder.withTag(contextEntry.getKey(), contextEntry.getValue());
                  } else {
                      eventBuilder.withExtra(contextEntry.getKey(), contextEntry.getValue());
                  }
              }
          }
  
          if (event.getMarker() != null) {
              eventBuilder.withTag(LOG4J_MARKER, event.getMarker().getName());
          }
  
          return eventBuilder;
      }
docs: Builds an EventBuilder based on the logging event.
  
  @param event Log generated.
  @return EventBuilder containing details provided by the logging system.