code: protected EventBuilder createEventBuilder(LoggingEvent loggingEvent) {
          EventBuilder eventBuilder = new EventBuilder()
              .withSdkIntegration("log4j")
              .withTimestamp(new Date(loggingEvent.getTimeStamp()))
              .withMessage(loggingEvent.getRenderedMessage())
              .withLogger(loggingEvent.getLoggerName())
              .withLevel(formatLevel(loggingEvent.getLevel()))
              .withExtra(THREAD_NAME, loggingEvent.getThreadName());
  
          ThrowableInformation throwableInformation = null;
          try {
              throwableInformation = loggingEvent.getThrowableInformation();
          } catch (NullPointerException expected) {
              // `throwableInformation` is already set.
          }
  
          if (throwableInformation != null) {
              Throwable throwable = throwableInformation.getThrowable();
              eventBuilder.withSentryInterface(new ExceptionInterface(throwable));
          } else if (loggingEvent.getLocationInformation().fullInfo != null) {
              LocationInfo location = loggingEvent.getLocationInformation();
              if (!LocationInfo.NA.equals(location.getFileName()) && !LocationInfo.NA.equals(location.getLineNumber())) {
                  StackTraceElement[] stackTrace = {asStackTraceElement(location)};
                  eventBuilder.withSentryInterface(new StackTraceInterface(stackTrace));
              }
          }
  
          if (loggingEvent.getNDC() != null) {
              eventBuilder.withExtra(LOG4J_NDC, loggingEvent.getNDC());
          }
  
          Set<String> extraTags = Sentry.getStoredClient().getMdcTags();
          @SuppressWarnings("unchecked")
          Map<String, Object> properties = (Map<String, Object>) loggingEvent.getProperties();
          for (Map.Entry<String, Object> mdcEntry : properties.entrySet()) {
              if (extraTags.contains(mdcEntry.getKey())) {
                  eventBuilder.withTag(mdcEntry.getKey(), mdcEntry.getValue().toString());
              } else {
                  eventBuilder.withExtra(mdcEntry.getKey(), mdcEntry.getValue());
              }
          }
  
          return eventBuilder;
      }
docs: Builds an EventBuilder based on the logging event.
  
  @param loggingEvent Log generated.
  @return EventBuilder containing details provided by the logging system.