public void setLoggerName(final String name) { super.setLoggerName(name); orig.setLoggerName(name); }
public LoggingEvent(String fqnOfCategoryClass, Category logger, Priority level, Object message, Throwable throwable) { this.fqnOfCategoryClass = fqnOfCategoryClass; this.logger = logger; this.level = level; logRecord = new ExtLogRecord(JBossLevelMapping.getLevelFor(level), message == null ? null : message.toString(), ExtLogRecord.FormatStyle.NO_FORMAT, fqnOfCategoryClass); if (logger != null) { logRecord.setLoggerName(categoryName = logger.getName()); } else { categoryName = null; } if (throwable != null) { logRecord.setThrown(throwable); } logRecord.setMillis(timeStamp = System.currentTimeMillis()); }
public LoggingEvent(String fqnOfCategoryClass, Category logger, long timeStamp, Priority level, Object message, Throwable throwable) { this.fqnOfCategoryClass = fqnOfCategoryClass; this.logger = logger; this.level = level; logRecord = new ExtLogRecord(JBossLevelMapping.getLevelFor(level), message == null ? null : message.toString(), ExtLogRecord.FormatStyle.NO_FORMAT, fqnOfCategoryClass); if (logger != null) { logRecord.setLoggerName(categoryName = logger.getName()); } else { categoryName = null; } if (throwable != null) { logRecord.setThrown(throwable); } logRecord.setMillis(this.timeStamp = timeStamp); }
if (categoryName != null) record.setLoggerName(categoryName); record.setMdc(mdcCopy == null ? Collections.<Object, Object>emptyMap() : mdcCopy); record.setNdc(ndc == null ? "" : ndc);
record.setLoggerName(getName()); String bundleName = null; ResourceBundle bundle = null;
logRecord = new ExtLogRecord(JBossLevelMapping.getLevelFor(level), message == null ? null : message.toString(), ExtLogRecord.FormatStyle.NO_FORMAT, fqnOfCategoryClass); if (logger != null) { logRecord.setLoggerName(categoryName = logger.getName()); } else { categoryName = null;
/** * Get a log record for a log4j event. If the event wraps a log record, that record is returned; otherwise * a new record is built up from the event. * * @param event the event * @return the log record */ public 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(LevelMapping.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; } }
super(original.getLevel(), original.getMessage()); setLoggerName(original.getLoggerName()); setMillis(original.getMillis()); setParameters(original.getParameters());