public void log(final Marker marker, final String fqcn, final int i, final String s1, final Object[] objects,
Throwable throwable) {
if (!logger.isEnabled(getLevel(i), (org.apache.logging.log4j.Marker) marker, s1)) {
return;
}
Message msg;
if (eventLogger && marker != null && marker.contains(EVENT_MARKER)) {
try {
final EventData data = (objects != null && objects[0] instanceof EventData) ? (EventData) objects[0] :
new EventData(s1);
msg = new StructuredDataMessage(data.getEventId(), data.getMessage(), data.getEventType());
for (final Map.Entry entry : data.getEventMap().entrySet()) {
final String key = entry.getKey().toString();
if (EventData.EVENT_TYPE.equals(key) || EventData.EVENT_ID.equals(key) ||
EventData.EVENT_MESSAGE.equals(key)) {
continue;
}
((StructuredDataMessage) msg).put(entry.getKey().toString(), entry.getValue().toString());
}
} catch (final Exception ex) {
msg = new ParameterizedMessage(s1, objects, throwable);
}
} else if (objects == null) {
msg = new SimpleMessage(s1);
} else {
msg = new ParameterizedMessage(s1, objects, throwable);
if (throwable != null) {
throwable = msg.getThrowable();
}
}
logger.log((org.apache.logging.log4j.Marker) marker, fqcn, getLevel(i), msg, throwable);
}