本文整理汇总了Java中org.apache.log4j.spi.LoggingEvent.getFQNOfLoggerClass方法的典型用法代码示例。如果您正苦于以下问题:Java LoggingEvent.getFQNOfLoggerClass方法的具体用法?Java LoggingEvent.getFQNOfLoggerClass怎么用?Java LoggingEvent.getFQNOfLoggerClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.log4j.spi.LoggingEvent
的用法示例。
在下文中一共展示了LoggingEvent.getFQNOfLoggerClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FastLoggingEvent
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
public FastLoggingEvent(LoggingEvent event, int stackOffset) {
super(event.getFQNOfLoggerClass(),
event.getLogger(),
event.getLevel(),
event.getMessage(),
(event.getThrowableInformation() != null ? event.getThrowableInformation().getThrowable() : null));
this.event = event;
this.stackOffset = stackOffset;
}
示例2: getStackOffset
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
public static int getStackOffset(LoggingEvent event) {
Throwable t = new Throwable();
String fqnOfCallingClass = event.getFQNOfLoggerClass();
if (fqnOfCallingClass == null) return 0;
// HACK
StackTraceElement stack[] = t.getStackTrace();
int offset = stack.length - 1;
for (; offset >= 0; offset--) {
if (stack[offset].getClassName().equals(fqnOfCallingClass)) break;
} // FOR
return (offset + 2);
}
示例3: defaultLogFormat
import org.apache.log4j.spi.LoggingEvent; //导入方法依赖的package包/类
static private Object defaultLogFormat(LoggingEvent loggingEvent) {
LoggingEventX eventX = new LoggingEventX(loggingEvent.getFQNOfLoggerClass(), loggingEvent.getLogger()
, loggingEvent.getTimeStamp(), loggingEvent.getLevel(), loggingEvent.getMessage(),
loggingEvent.getThreadName(), loggingEvent.getThrowableInformation(), loggingEvent.getNDC(),
loggingEvent.getLocationInformation(), loggingEvent.getProperties());
eventX.setLogTime(new Date(loggingEvent.getTimeStamp()));
eventX.setLogLevel(eventX.getLevel().toString());
return eventX;
}