@SuppressWarnings("unchecked")
  @Override
  public byte[] toBytes(LogEvent loggingEvent) {
    Map<String, Object> loggingEventMap = encodeToMap(loggingEvent, includeLocationInfo);
    return jsonSerde.toBytes(loggingEventMap);
  }
Constructs the serde.

@param includeLocationInfo
         Whether to include location info in the logging event or not.
samza-log4j2/src/main/java/org/apache/samza/logging/log4j2/serializers/LoggingEventJsonSerde.java