本文整理汇总了Java中org.apache.log4j.spi.LoggingEvent.getRenderedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java LoggingEvent.getRenderedMessage方法的具体用法?Java LoggingEvent.getRenderedMessage怎么用?Java LoggingEvent.getRenderedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.log4j.spi.LoggingEvent
的用法示例。
在下文中一共展示了LoggingEvent.getRenderedMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: countLinesWithMessage
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
public int countLinesWithMessage(final String text) {
int count = 0;
for (LoggingEvent e: getLog()) {
String msg = e.getRenderedMessage();
if (msg != null && msg.contains(text)) {
count++;
}
}
return count;
}
示例2: getMessage
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
/**
* 获得message
* @param event
* @return
*/
private String getMessage(LoggingEvent event) {
if (this.layout == null) {
return event.getRenderedMessage();
} else {
// 获取host和app
String msg = System.nanoTime() + Constants.SEMICOLON + this.layout.format(event);
return msg.replaceFirst(Constants.APP_NAME, this.app).replaceFirst(Constants.HOSTNAME, this.host);
}
}
示例3: append
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
@Override
protected void append(LoggingEvent loggingEvent) {
messages = loggingEvent.getRenderedMessage();
}
示例4: doAppend
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
@Override
public void doAppend(LoggingEvent event) {
message = event.getRenderedMessage();
}
示例5: subAppend
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
private String subAppend(LoggingEvent event) {
return (this.layout == null) ? event.getRenderedMessage() : this.layout.format(event);
}