String getFullyQualifiedName(LoggingEvent event) { return event.getLocationInformation().getClassName(); } }
/** * Format a logging event. * @param event event to format. * @param toAppendTo string buffer to which class name will be appended. */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { final int initialLength = toAppendTo.length(); LocationInfo li = event.getLocationInformation(); if (li == null) { toAppendTo.append(LocationInfo.NA); } else { toAppendTo.append(li.getClassName()); } abbreviate(initialLength, toAppendTo); } }
/** * 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); }
LocationInfo locationInfo = event.getLocationInformation(); buf.append("<log4j:locationInfo class=\""); buf.append(Transform.escapeTags(locationInfo.getClassName())); buf.append("\" method=\""); buf.append(Transform.escapeTags(locationInfo.getMethodName()));
protected void appendMavenCoordinates(LoggingEvent loggingEvent) { LocationInfo information = loggingEvent.getLocationInformation(); if (information != null) { String coordinates = MavenCoordHelper.getMavenCoordinates(information.getClassName()); if (coordinates != null) { loggingEvent.setProperty("maven.coordinates", coordinates); } } }
String getFullyQualifiedName(LoggingEvent event) { return event.getLocationInformation().getClassName(); } }
String getFullyQualifiedName(LoggingEvent event) { return event.getLocationInformation().getClassName(); } }
if (locationInformation != null) { answer.setFileName(locationInformation.getFileName()); answer.setClassName(locationInformation.getClassName()); answer.setMethodName(locationInformation.getMethodName()); answer.setLineNumber(locationInformation.getLineNumber());
/** * Format a logging event. * @param event event to format. * @param toAppendTo string buffer to which class name will be appended. */ public void format(final LoggingEvent event, final StringBuffer toAppendTo) { final int initialLength = toAppendTo.length(); LocationInfo li = event.getLocationInformation(); if (li == null) { toAppendTo.append(LocationInfo.NA); } else { toAppendTo.append(li.getClassName()); } abbreviate(initialLength, toAppendTo); } }
LocationInfo locationInfo = event.getLocationInformation(); buf.append("<log4j:locationInfo class=\""); buf.append(Transform.escapeTags(locationInfo.getClassName())); buf.append("\" method=\""); buf.append(Transform.escapeTags(locationInfo.getMethodName()));
public String getClassName() { return m_delegate.getClassName(); }
String getFullyQualifiedName(LoggingEvent event) { return event.getLocationInformation().getClassName(); } }
String getFullyQualifiedName(LoggingEvent event) { return event.getLocationInformation().getClassName(); } }
private String getSourceClassName() { String className = loggingEvent.getLocationInformation().getClassName(); if (LocationInfo.NA.equals(className)) { return null; } return className; }
String getFullyQualifiedName(LoggingEvent event) { return event.getLocationInformation().getClassName(); } }
private String getSourceClassName() { String className = loggingEvent.getLocationInformation().getClassName(); if(LocationInfo.NA.equals(className)){ return null; } return className; }
private String getSourceClassName() { String className = loggingEvent.getLocationInformation().getClassName(); if(LocationInfo.NA.equals(className)){ return null; } return className; }
protected void appendMavenCoordinates(LoggingEvent loggingEvent) { LocationInfo information = loggingEvent.getLocationInformation(); if (information != null) { String coordinates = MavenCoordHelper.getMavenCoordinates(information.getClassName()); if (coordinates != null) { loggingEvent.setProperty("maven.coordinates", coordinates); } } }
protected void appendMavenCoordinates(LoggingEvent loggingEvent) { LocationInfo information = loggingEvent.getLocationInformation(); if (information != null) { String coordinates = MavenCoordHelper.getMavenCoordinates(information.getClassName()); if (coordinates != null) { loggingEvent.setProperty("maven.coordinates", coordinates); } } }
protected void appendMavenCoordinates(LoggingEvent loggingEvent) { LocationInfo information = loggingEvent.getLocationInformation(); if (information != null) { String coordinates = MavenCoordHelper.getMavenCoordinates(information.getClassName()); if (coordinates != null) { loggingEvent.setProperty("maven.coordinates", coordinates); } } }