本文整理汇总了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;
}