Package ch.qos.logback.classic.spi

Examples of ch.qos.logback.classic.spi.LoggingEvent


     Get the oldest (first) element in the buffer. The oldest element
     is removed from the buffer.
  */
  public
  LoggingEvent get() {
    LoggingEvent r = null;
    if(numElems > 0) {
      numElems--;
      r = ea[first];
      ea[first] = null;
      if(++first == maxSize)
View Full Code Here


    }
    return (Class[]) fullTypeList.toArray(CoreGlobal.EMPTY_CLASS_ARRAY);
  }

  protected Object[] getParameterValues(Object event) {
    LoggingEvent loggingEvent = (LoggingEvent) event;
    final int matcherListSize = matcherList.size();
   
    int i = 0;
    Object[] values = new Object[DEFAULT_PARAM_NAME_LIST.size()+matcherListSize];

    values[i++] = Level.DEBUG_INTEGER;
    values[i++] = Level.INFO_INTEGER;
    values[i++] = Level.WARN_INTEGER;
    values[i++] = Level.ERROR_INTEGER;
   
    values[i++] = loggingEvent;
    values[i++] = loggingEvent.getMessage();   
    values[i++] = loggingEvent.getLoggerRemoteView();
    values[i++] = loggingEvent.getLevel().toInteger();
    values[i++] = new Long(loggingEvent.getTimeStamp());
    values[i++] = loggingEvent.getMarker();
   
   
    for(int j = 0; j < matcherListSize; j++) {
      values[i++] = (Matcher) matcherList.get(j);
    }
View Full Code Here

   * these methods more easily understandable, avoiding many instances
   * of passing null parameters.
   */
  private void filterAndLog(String caller, Level level, String format,
      Throwable t) {
    LoggingEvent le = new LoggingEvent(caller, this, level, format, t, null);
    if (loggerContext.getFilterChainDecision(le) != Filter.DENY) {
      callAppenders(le);
    }
  }
View Full Code Here

    }
  }

  private void filterAndLog(String caller, Level level, String format,
      Object[] argArray, Throwable t) {
    LoggingEvent le = new LoggingEvent(caller, this, level, format, t, argArray);
    if (loggerContext.getFilterChainDecision(le) != Filter.DENY) {
      callAppenders(le);
    }
  }
View Full Code Here

    }
  }

  private void filterAndLog(String caller, Level level, Marker marker,
      String format, Object[] argArray, Throwable t) {
    LoggingEvent le = new LoggingEvent(caller, this, level, format, t, argArray);
    le.setMarker(marker);
    if (loggerContext.getFilterChainDecision(le) != Filter.DENY) {
      callAppenders(le);
    }
  }
View Full Code Here

    super.stop();
  }
 
  @Override
  public String convert(Object event) {
    LoggingEvent loggingEvent = (LoggingEvent) event;
    Map<String, String> mdcPropertyMap = loggingEvent.getMDCPropertyMap();
    if (mdcPropertyMap != null) {
      return loggingEvent.getMDCPropertyMap().get(key);
    } else {
      return "";
    }
  }
View Full Code Here

   *
   * @see ch.qos.logback.core.net.SyslogAppenderBase#getSeverityForEvent(java.lang.Object)
   */
  @Override
  public int getSeverityForEvent(Object eventObject) {
    LoggingEvent event = (LoggingEvent) eventObject;
    return LevelToSyslogSeverity.convert(event);
  }
View Full Code Here

      simpleFormat.setTimeZone(tz);
    }
  }
 
  public String convert(Object event) {
    LoggingEvent le = (LoggingEvent) event;
    long timestamp = le.getTimeStamp();
   
    // if called multiple times within the same millisecond
    // return old value
    if(timestamp == lastTimestamp) {
      return timesmapStr;
View Full Code Here

    evaluatorList.add(ee);
  }

  public String convert(Object event) {

    LoggingEvent le = (LoggingEvent) event;
    StringBuffer buf = new StringBuffer();

    if (evaluatorList != null) {
      boolean printCallerData = false;
      for (int i = 0; i < evaluatorList.size(); i++) {
        EventEvaluator ee = (EventEvaluator) evaluatorList.get(i);
        try {
          if (ee.evaluate(event)) {
            printCallerData = true;
            break;
          }
        } catch (EvaluationException eex) {
          // just ignore evaluation exception
        }
      }

      if (!printCallerData) {
        return CoreGlobal.EMPTY_STRING;
      }
    }

    CallerData[] cda = le.getCallerData();
    if (cda != null && cda.length > 0) {
      int limit = depth < cda.length ? depth : cda.length;

      for (int i = 0; i < limit; i++) {
        buf.append("Caller+");
View Full Code Here

  // System.err.println("-------------------------Finalize called");
  // System.err.flush();
  // }

  public void run() {
    LoggingEvent event;
    Logger remoteLogger;

    try {
      while (true) {
        // read an event from the wire
        event = (LoggingEvent) ois.readObject();
        // get a logger from the hierarchy. The name of the logger is taken to
        // be the name contained in the event.
        remoteLogger = context.getLogger(event.getLoggerRemoteView().getName());
        // apply the logger-level filter
        if (remoteLogger.isEnabledFor(event.getLevel())) {
          // finally log the event as if was generated locally
          remoteLogger.callAppenders(event);
        }
      }
    } catch (java.io.EOFException e) {
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.spi.LoggingEvent

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.