本文整理匯總了Java中org.slf4j.Marker.add方法的典型用法代碼示例。如果您正苦於以下問題:Java Marker.add方法的具體用法?Java Marker.add怎麽用?Java Marker.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.slf4j.Marker
的用法示例。
在下文中一共展示了Marker.add方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLoggingMarker
import org.slf4j.Marker; //導入方法依賴的package包/類
public Marker getLoggingMarker() {
// If we get more optional header fields, we should probably exclude them if they are empty.
Marker messageMarker =
append("messageId", messageId)
.and(append("partitionId", partitionId))
.and(append("partitioningKey", partitioningKey))
.and(append("offset", offset))
.and(append("messageId", messageId))
.and(append("correlationId", correlationId))
.and(append("requestCorrelationId", requestCorrelationId));
// Nota bene: without the toString the marker tries to convert the object into Json, which produces strange results
if (topic != null) {
messageMarker.add(append("topic", topic.toString()));
}
if (replyTo != null) {
messageMarker.add(append("replyTo", replyTo.toString()));
}
if (type != null) {
messageMarker.add(append("messageType", type.toString()));
}
return messageMarker;
}