Package org.apache.log4j.spi

Examples of org.apache.log4j.spi.LoggingEvent


    long before = System.currentTimeMillis();

    int RUN = 1000;
    int i = 0;
    while(i++ < RUN) {     
      LoggingEvent event0 = new LoggingEvent("x", cat, Priority.ERROR,
               "Message "+i, null);
     
      Throwable t = new Exception("hello "+i);
      LoggingEvent event1 = new LoggingEvent("x", cat, Priority.ERROR,
               "Message "+i, t);
     

      if(i % 10 == 0) { 
  event1.getThreadName();
  view.add(event1);
      } else {
  event0.getThreadName();
  view.add(event0);
      }
View Full Code Here


      //      System.out.println(o + " ============== " + i++);
      //LogLog.error("=======", new Exception());
      //setIcon(longIcon);
      if(value instanceof LoggingEvent) {
  LoggingEvent event = (LoggingEvent) value;
  String str = layout.format(event);
  String t = event.getThrowableInformation();

  if(t != null) {
    setText(str + Layout.LINE_SEP + t);
  } else
    setText(str);
View Full Code Here

      this.wait();
    } catch(Exception e) {
    }
  }
  for(int i = 0; i < burst; i++) {
    LoggingEvent event = new LoggingEvent("x", cat, Priority.DEBUG,
            "Message "+counter, null);

    event.getThreadName();   
    if(counter % 50 == 0) {
      //event.throwable = new Exception("hello "+counter);
    }
    counter++;
    view.add(event);
View Full Code Here

    long before = System.currentTimeMillis();

    int RUN = 10000;
    int i = 0;
    while(i++ < RUN) {     
      LoggingEvent event = new LoggingEvent("x", cat, Priority.ERROR,
              "Message "+i, null);
      event.getThreadName();
      if(i % 10 == 0) {
  //event.throwable = new Exception("hello "+i);
      }
      appender.add(event);
    }
View Full Code Here

      System.out.println(o + " ============== " + i++);
      //LogLog.error("=======", new Exception());
      //setIcon(longIcon);
      if(value instanceof LoggingEvent) {
  LoggingEvent event = (LoggingEvent) value;
  String str = layout.format(event);
  String t = event.getThrowableInformation();
 
  if(t != null) {
    System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
    setText(str + Layout.LINE_SEP + t);
  } else
View Full Code Here

   
  public
  void actionPerformed(ActionEvent e) {
    System.out.println("Action occured");

    LoggingEvent event = new LoggingEvent("x", cat, Priority.DEBUG,
              "Message "+j, null);
   
    if(j % 5 == 0) {
      //event.throwable = new Exception("hello "+j);
    }
View Full Code Here

    logTable.addSortableColumn("Count");
    logTable.addSortableColumn("Level", new LogLevelType(), null);
    logTable.addSortableColumn("Message");
    for (DedupedLogEvent dev : LogService.getInstance().getEvents()) {
      clear = false;
      LoggingEvent ev = dev.getEvent();
      Object application = ev.getMDC("application");
      if (application == null)
        application = "";
      String msg = ev.getMessage().toString();
      StringBuilder text = new StringBuilder();
      for (int i = 0; i < msg.length(); i++) {
        char c = msg.charAt(i);
        switch (Character.getType(c)) {
          case Character.UNASSIGNED:
          case Character.LINE_SEPARATOR:
          case Character.NON_SPACING_MARK:
          case Character.PRIVATE_USE:
            c = '?';
          default:
            text.append(c);
        }
       
      }
      StringBuilder builder = new StringBuilder(text.toString());
      if (ev.getThrowableStrRep() != null)
        for (String line : ev.getThrowableStrRep())
          builder.append("\n\t").append(line);
      msg = sanitize(builder.toString().trim());
      msg = "<pre class='logevent'>" + msg + "</pre>";
      logTable.addRow(ev.getTimeStamp(), application, dev.getCount(), ev.getLevel(), msg);
    }
    if (!clear)
      logTable.setSubCaption("<a href='/op?action=clearLog&redir=" + currentPage(req) + "'>Clear&nbsp;All&nbsp;Events</a>");
    logTable.generate(req, sb);
    if (!clear)
View Full Code Here

          return;
        }
       
        if (isFull != 0) {
          isFull++;
          event = new LoggingEvent(category.getName(),category,Priority.FATAL,"dropped " + isFull + " messages",null);
        }
        isFull = 0;
       
        bf.put(event);
        if(bf.wasEmpty()) {
View Full Code Here

    */
    public void run() {

      //Category cat = Category.getInstance(Dispatcher.class.getName());

      LoggingEvent event;

      while(true) {
        synchronized(bf) {
    if(bf.length() == 0) {
      // Exit loop if interrupted but only if the the buffer is empty.
View Full Code Here

        return;
      }

      if (isFull != 0) {
        isFull++;
        event = new LoggingEvent(category.getName(), category,
            Priority.FATAL, "dropped " + isFull + " messages", null);
      }
      isFull = 0;

      // cat.debug("About to put new event in buffer.");
View Full Code Here

TOP

Related Classes of org.apache.log4j.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.