本文整理匯總了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);
}