Package ch.qos.logback.core.status

Examples of ch.qos.logback.core.status.ErrorStatus


      //switch out the message
      event.setMessage(sbuf.toString());
      //write it
      writeOut(event);
    } catch (IOException ioe) {
      addStatus(new ErrorStatus("IO failure in appender", this, ioe));
    }
  }
View Full Code Here


      setContextForConverters(head);
      ConverterUtil.startConverters(this.head);
      super.start();
    } catch (ScanException sce) {
      StatusManager sm = getContext().getStatusManager();
      sm.add(new ErrorStatus("Failed to parse pattern \"" + getPattern()
          + "\".", this, sce));
    }
  }
View Full Code Here

  }

  final void noAppenderDefinedWarning(final Logger logger) {
    if (noAppenderWarning++ == 0) {
      getStatusManager().add(
          new ErrorStatus("No appenders present in context [" + getName()
              + "] for logger [" + logger.getName() + "].", logger));
    }
  }
View Full Code Here

    assertTrue(result.contains("|-INFO in "+this.getClass().getName()));
  }

  @Test
  public void testNested() {
    Status s0 = new ErrorStatus("test0", this);
    Status s1 = new InfoStatus("test1", this);
    Status s11 = new InfoStatus("test11", this);
    Status s12 = new InfoStatus("test12", this);
    s1.add(s11);
    s1.add(s12);
View Full Code Here

    assertTrue(result.contains("    |-WARN in "+this.getClass().getName()));
  }

  @Test
  public void testWithException() {
    Status s0 = new ErrorStatus("test0", this);
    Status s1 = new InfoStatus("test1", this, new Exception("testEx"));
    Status s11 = new InfoStatus("test11", this);
    Status s12 = new InfoStatus("test12", this);
    s1.add(s11);
    s1.add(s12);
View Full Code Here

  BasicStatusManager bsm = new BasicStatusManager();

  @Test
  public void smoke() {
    bsm.add(new ErrorStatus("hello", this));
    assertEquals(Status.ERROR, bsm.getLevel());

    List<Status> statusList = bsm.getCopyOfStatusList();
    assertNotNull(statusList);
    assertEquals(1, statusList.size());
View Full Code Here

  @Test
  public void many() {
    int margin = 300;
    int len = MAX_HEADER_COUNT + TAIL_SIZE + margin;
    for (int i = 0; i < len; i++) {
      bsm.add(new ErrorStatus("" + i, this));
    }

    List<Status> statusList = bsm.getCopyOfStatusList();
    assertNotNull(statusList);
    assertEquals(MAX_HEADER_COUNT + TAIL_SIZE, statusList.size());
    List<Status> witness = new ArrayList<Status>();
    for (int i = 0; i < MAX_HEADER_COUNT; i++) {
      witness.add(new ErrorStatus("" + i, this));
    }
    for (int i = 0; i < TAIL_SIZE; i++) {
      witness.add(new ErrorStatus("" + (MAX_HEADER_COUNT + margin + i), this));
    }
    assertEquals(witness, statusList);
  }
View Full Code Here

          + getDescription(), this));
    }
  }

  public void postIOFailure(IOException e) {
    addStatusIfCountNotOverLimit(new ErrorStatus("IO failure while writing to "
        + getDescription(), this, e));
    presumedClean = false;
    if (recoveryCoordinator == null) {
      recoveryCoordinator = new RecoveryCoordinator();
    }
View Full Code Here

    // subsequent writes must always be in append mode
    try {
      os = openNewOutputStream();
      presumedClean = true;
    } catch (IOException e) {
      addStatusIfCountNotOverLimit(new ErrorStatus("Failed to open "
          + getDescription(), this, e));
    }
  }
View Full Code Here

    assertTrue(checkFileErrors());
  }
 
  private boolean checkError() {
    Iterator it = context.getStatusManager().getCopyOfStatusList().iterator();
    ErrorStatus es = (ErrorStatus)it.next();
    return PropertyAction.INVALID_ATTRIBUTES.equals(es.getMessage());
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.status.ErrorStatus

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.