Examples of WarnStatus


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

  private void gzCompress(String nameOfFile2gz, String nameOfgzedFile) {
    File file2gz = new File(nameOfFile2gz);

    if (!file2gz.exists()) {
      addStatus(new WarnStatus("The file to compress named [" + nameOfFile2gz
              + "] does not exist.", this));

      return;
    }


    if (!nameOfgzedFile.endsWith(".gz")) {
      nameOfgzedFile = nameOfgzedFile + ".gz";
    }

    File gzedFile = new File(nameOfgzedFile);

    if (gzedFile.exists()) {
      addWarn("The target compressed file named ["
              + nameOfgzedFile + "] exist already. Aborting file compression.");
      return;
    }

    addInfo("GZ compressing [" + file2gz + "] as ["+gzedFile+"]");
    createMissingTargetDirsIfNecessary(gzedFile);

    BufferedInputStream bis = null;
    GZIPOutputStream gzos = null;
    try {
      bis = new BufferedInputStream(new FileInputStream(nameOfFile2gz));
      gzos = new GZIPOutputStream(new FileOutputStream(nameOfgzedFile));
      byte[] inbuf = new byte[BUFFER_SIZE];
      int n;

      while ((n = bis.read(inbuf)) != -1) {
        gzos.write(inbuf, 0, n);
      }

      bis.close();
      bis = null;
      gzos.close();
      gzos = null;

      if (!file2gz.delete()) {
        addStatus(new WarnStatus("Could not delete [" + nameOfFile2gz + "].",
                this));
      }
    } catch (Exception e) {
      addStatus(new ErrorStatus("Error occurred while compressing ["
              + nameOfFile2gz + "] into [" + nameOfgzedFile + "].", this, e));
View Full Code Here

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

  public void addInfo(String msg, Throwable ex) {
    addStatus(new InfoStatus(msg, getOrigin(), ex));
  }

  public void addWarn(String msg) {
    addStatus(new WarnStatus(msg, getOrigin()));
  }
View Full Code Here

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

  public void addWarn(String msg) {
    addStatus(new WarnStatus(msg, getOrigin()));
  }

  public void addWarn(String msg, Throwable ex) {
    addStatus(new WarnStatus(msg, getOrigin(), ex));
  }
View Full Code Here

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

  public void addInfo(String msg, Throwable ex) {
    addStatus(new InfoStatus(msg, getDeclaredOrigin(), ex));
  }

  public void addWarn(String msg) {
    addStatus(new WarnStatus(msg, getDeclaredOrigin()));
  }
View Full Code Here

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

  public void addWarn(String msg) {
    addStatus(new WarnStatus(msg, getDeclaredOrigin()));
  }

  public void addWarn(String msg, Throwable ex) {
    addStatus(new WarnStatus(msg, getDeclaredOrigin(), ex));
  }
View Full Code Here

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

    try {
      guard.set(Boolean.TRUE);

      if (!this.started) {
        if (statusRepeatCount++ < ALLOWED_REPEATS) {
          addStatus(new WarnStatus(
              "Attempted to append to non started appender [" + name + "].",
              this));
        }
        return;
      }
View Full Code Here

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

  static void addInfo(Context context, String msg) {
    addStatus(context, new InfoStatus(msg, origin));
  }

  static void addWarn(Context context, String msg) {
    addStatus(context, new WarnStatus(msg, origin));
  }
View Full Code Here

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

    if (filename == null) {
      String jettyHomeProperty = System.getProperty("jetty.home");

      filename = jettyHomeProperty + File.separatorChar + DEFAULT_CONFIG_FILE;
      getStatusManager().add(
          new WarnStatus("filename property not set. Assuming [" + filename
              + "]", this));

    }
    try {
      File configFile = new File(filename);
View Full Code Here

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

  }

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

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

    } catch (IOException e) {
      sm.add(new ErrorStatus("Failed to get url list for resource [" + resourceName + "]",
              loggerContext, e));
    }
    if (urlSet != null && urlSet.size() > 1) {
      sm.add(new WarnStatus("Resource [" + resourceName + "] occurs multiple times on the classpath.",
              loggerContext));
      for (URL url : urlSet) {
        sm.add(new WarnStatus("Resource [" + resourceName + "] occurs at [" + url.toString() + "]",
                loggerContext));
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.