Package org.apache.log4j.spi.location

Examples of org.apache.log4j.spi.location.LocationInfo


  /**
   * {@inheritDoc}
   */
  public void format(final LoggingEvent event, final StringBuffer output) {
    LocationInfo locationInfo = event.getLocationInformation();

    if (locationInfo != null) {
      output.append(locationInfo.getLineNumber());
    }
  }
View Full Code Here


  /**
   * {@inheritDoc}
   */
  public void format(final LoggingEvent event, final StringBuffer output) {
    LocationInfo locationInfo = event.getLocationInformation();

    if (locationInfo != null) {
      output.append(locationInfo.getFullInfo());
    }
  }
View Full Code Here

   */
  public LocationInfo getLocationInformation() {
    // we rely on the fact that fqnOfLoggerClass does not survive
    // serialization
    if (locationInfo == null && fqnOfLoggerClass != null) {
      locationInfo = new LocationInfo(new Throwable(), fqnOfLoggerClass);
    }
    return locationInfo;
  }
View Full Code Here

                    Level levelImpl = Level.toLevel(level);
                    LoggingEvent event = new LoggingEvent(
                            eventLogger.getName(), eventLogger, levelImpl,
                            message, null);
                    event.setLocationInformation(new LocationInfo(fileName,
                            className, methodName, lineNumber));
                    properties.putAll(mdc);
                    event.setTimeStamp(timeStamp);
                    event.setThrowableInformation(new ThrowableInformation(
                            exception));
View Full Code Here

        output.write("]]></log4j:throwable>\r\n");
      }
    }

    if (locationInfo) {
      LocationInfo locationInfo = event.getLocationInformation();
      output.write("<log4j:locationInfo class=\"");
      Transform.escapeTags(locationInfo.getClassName(), output);
      output.write("\" method=\"");
      Transform.escapeTags(locationInfo.getMethodName(), output);
      output.write("\" file=\"");
      output.write(locationInfo.getFileName());
      output.write("\" line=\"");
      output.write(locationInfo.getLineNumber());
      output.write("\"/>\r\n");
    }

    Set propertySet = event.getPropertyKeySet();
View Full Code Here

    throws ScanError {
    super(operator, rightSide);
  }

  protected String getLeftSide(LoggingEvent event) {
    LocationInfo li = event.getLocationInformation();
    return li.getClassName();
  }
View Full Code Here

    throws ScanError {
    super(operator, rightSide);
  }

  protected String getLeftSide(LoggingEvent event) {
    LocationInfo li = event.getLocationInformation();
    return li.getMethodName();
  }
View Full Code Here

          insertStatement.setString(5, event.getLevel().toString());
          insertStatement.setString(6, event.getNDC());
          insertStatement.setString(7, event.getThreadName());
          insertStatement.setShort(8, DBHelper.computeReferenceMask(event));
         
          LocationInfo li;
         
          if (event.locationInformationExists() || locationInfo) {
              li = event.getLocationInformation();
          } else {
              li = LocationInfo.NA_LOCATION_INFO;
          }
         
          insertStatement.setString(9, li.getFileName());
          insertStatement.setString(10, li.getClassName());
          insertStatement.setString(11, li.getMethodName());
          insertStatement.setString(12, li.getLineNumber());
         
          int updateCount = insertStatement.executeUpdate();
          if (updateCount != 1) {
              getLogger().warn("Failed to insert loggingEvent");
          }
View Full Code Here

TOP

Related Classes of org.apache.log4j.spi.location.LocationInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.