/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { LocationInfo locationInfo = event.getLocationInformation(); if (locationInfo != null) { toAppendTo.append(locationInfo.getMethodName()); } } }
public String convert(LoggingEvent event) { LocationInfo locationInfo = event.getLocationInformation(); switch(type) { case FULL_LOCATION_CONVERTER: return locationInfo.fullInfo; case METHOD_LOCATION_CONVERTER: return locationInfo.getMethodName(); case LINE_LOCATION_CONVERTER: return locationInfo.getLineNumber(); case FILE_LOCATION_CONVERTER: return locationInfo.getFileName(); default: return null; } } }
@Override public String format(LoggingEvent event) { java.util.logging.Level level = convertLevel(event.getLevel()); LogRecord logRecord = new LogRecord(level, event.getMessage().toString()); logRecord.setLoggerName(event.getLoggerName()); logRecord.setMillis(event.getTimeStamp()); logRecord.setSourceClassName(event.getLoggerName()); logRecord.setSourceMethodName(event.getLocationInformation().getMethodName()); logRecord.setThreadID((int) Thread.currentThread().getId()); return logger.format(logRecord); }
/** * Append a log event at the appropriate JUL level, depending on the log4j level. */ @Override protected void append(LoggingEvent loggingEvent) { java.util.logging.Logger logger = java.util.logging.Logger.getLogger(loggingEvent.getLoggerName()); if (logger == null) { LogLog.warn(format("Cannot obtain JUL %s. Verify that this appender is used while an appropriate LogManager is active.", loggingEvent.getLoggerName())); return; } Level level = loggingEvent.getLevel(); java.util.logging.Level julLevel = convertLog4jLevel(level); LogRecord record = new LogRecord(julLevel, loggingEvent.getRenderedMessage()); record.setMillis(loggingEvent.getTimeStamp()); LocationInfo location = loggingEvent.getLocationInformation(); if (location != null) { record.setSourceClassName(location.getClassName()); record.setSourceMethodName(location.getMethodName()); } logger.log(record); }
buf.append(Transform.escapeTags(locationInfo.getClassName())); buf.append("\" method=\""); buf.append(Transform.escapeTags(locationInfo.getMethodName())); buf.append("\" file=\""); buf.append(Transform.escapeTags(locationInfo.getFileName()));
/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { LocationInfo locationInfo = event.getLocationInformation(); if (locationInfo != null) { toAppendTo.append(locationInfo.getMethodName()); } } }
answer.setFileName(locationInformation.getFileName()); answer.setClassName(locationInformation.getClassName()); answer.setMethodName(locationInformation.getMethodName()); answer.setLineNumber(locationInformation.getLineNumber());
public String convert(LoggingEvent event) { LocationInfo locationInfo = event.getLocationInformation(); switch(type) { case FULL_LOCATION_CONVERTER: return locationInfo.fullInfo; case METHOD_LOCATION_CONVERTER: return locationInfo.getMethodName(); case LINE_LOCATION_CONVERTER: return locationInfo.getLineNumber(); case FILE_LOCATION_CONVERTER: return locationInfo.getFileName(); default: return null; } } }
public String convert(LoggingEvent event) { LocationInfo locationInfo = event.getLocationInformation(); switch(type) { case FULL_LOCATION_CONVERTER: return locationInfo.fullInfo; case METHOD_LOCATION_CONVERTER: return locationInfo.getMethodName(); case LINE_LOCATION_CONVERTER: return locationInfo.getLineNumber(); case FILE_LOCATION_CONVERTER: return locationInfo.getFileName(); default: return null; } } }
buf.append(Transform.escapeTags(locationInfo.getClassName())); buf.append("\" method=\""); buf.append(Transform.escapeTags(locationInfo.getMethodName())); buf.append("\" file=\""); buf.append(Transform.escapeTags(locationInfo.getFileName()));
public String getMethodName() { return m_delegate.getMethodName(); } }
public String getMethodName() { return m_delegate.getMethodName(); } }
private String getSourceMethodName() { String methodName = loggingEvent.getLocationInformation().getMethodName(); if(LocationInfo.NA.equals(methodName)){ return null; } return methodName; }
/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { LocationInfo locationInfo = event.getLocationInformation(); if (locationInfo != null) { toAppendTo.append(locationInfo.getMethodName()); } } }
/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { LocationInfo locationInfo = event.getLocationInformation(); if (locationInfo != null) { toAppendTo.append(locationInfo.getMethodName()); } } }
private String getSourceMethodName() { String methodName = loggingEvent.getLocationInformation().getMethodName(); if (LocationInfo.NA.equals(methodName)) { return null; } return methodName; }
/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { LocationInfo locationInfo = event.getLocationInformation(); if (locationInfo != null) { toAppendTo.append(locationInfo.getMethodName()); } } }
/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { LocationInfo locationInfo = event.getLocationInformation(); if (locationInfo != null) { toAppendTo.append(locationInfo.getMethodName()); } } }
private String getSourceMethodName() { String methodName = loggingEvent.getLocationInformation().getMethodName(); if(LocationInfo.NA.equals(methodName)){ return null; } return methodName; }
@Override public String format(LoggingEvent event) { java.util.logging.Level level = convertLevel(event.getLevel()); LogRecord logRecord = new LogRecord(level, event.getMessage().toString()); logRecord.setLoggerName(event.getLoggerName()); logRecord.setMillis(event.getTimeStamp()); logRecord.setSourceClassName(event.getLoggerName()); logRecord.setSourceMethodName(event.getLocationInformation().getMethodName()); logRecord.setThreadID((int) Thread.currentThread().getId()); return logger.format(logRecord); }