appender.close();
}
}
static ExtLogRecord getLogRecordFor(LoggingEvent event) {
final ExtLogRecord rec = (ExtLogRecord) event.getProperties().get("org.jboss.logmanager.record");
if (rec != null) {
return rec;
}
final ExtLogRecord newRecord = new ExtLogRecord(JBossLevelMapping.getLevelFor(event.getLevel()), (String) event.getMessage(), event.getFQNOfLoggerClass());
newRecord.setLoggerName(event.getLoggerName());
newRecord.setMillis(event.getTimeStamp());
newRecord.setThreadName(event.getThreadName());
newRecord.setThrown(event.getThrowableInformation().getThrowable());
newRecord.setNdc(event.getNDC());
if (event.locationInformationExists()) {
final LocationInfo locationInfo = event.getLocationInformation();
newRecord.setSourceClassName(locationInfo.getClassName());
newRecord.setSourceFileName(locationInfo.getFileName());
newRecord.setSourceLineNumber(Integer.parseInt(locationInfo.getLineNumber()));
newRecord.setSourceMethodName(locationInfo.getMethodName());
}
return newRecord;
}