code: public LoggingEvent rewrite(final LoggingEvent source) {
          Object msg = source.getMessage();
          if (msg instanceof Map) {
              Map props = new HashMap(source.getProperties());
              Map eventProps = (Map) msg;
              //
              //   if the map sent in the logging request
              //      has "message" entry, use that as the message body
              //      otherwise, use the entire map.
              //
              Object newMsg = eventProps.get("message");
              if (newMsg == null) {
                  newMsg = msg;
              }
  
              for(Iterator iter = eventProps.entrySet().iterator();
                      iter.hasNext();
                    ) {
                  Map.Entry entry = (Map.Entry) iter.next();
                  if (!("message".equals(entry.getKey()))) {
                      props.put(entry.getKey(), entry.getValue());
                  }
              }
  
              return new LoggingEvent(
                      source.getFQNOfLoggerClass(),
                      source.getLogger() != null ? source.getLogger(): Logger.getLogger(source.getLoggerName()), 
                      source.getTimeStamp(),
                      source.getLevel(),
                      newMsg,
                      source.getThreadName(),
                      source.getThrowableInformation(),
                      source.getNDC(),
                      source.getLocationInformation(),
                      props);
          } else {
              return source;
          }
  
      }
docs: {@inheritDoc}