Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, QOS.ch. All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.core.rolling;
Implements methods common to most, it not all, rolling policies. Currently such methods are limited to a compression mode getter/setter.

Author(s):
Ceki Gülcü
public abstract class RollingPolicyBase extends ContextAwareBase implements
    RollingPolicy {
  // fileNamePatternStr is always slashified, see setter
  protected String fileNamePatternStr;
  private FileAppender parent;
  // use to name files within zip file, i.e. the zipEntry
  private boolean started;

  
Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr. Patterns ending with .gz imply GZIP compression, endings with '.zip' imply ZIP compression. Otherwise and by default, there is no compression.
  protected void determineCompressionMode() {
    if (.endsWith(".gz")) {
      addInfo("Will use gz compression");
    } else if (.endsWith(".zip")) {
      addInfo("Will use zip compression");
    } else {
      addInfo("No compression will be used");
    }
  }
  public void setFileNamePattern(String fnp) {
     = fnp;
  }
  public String getFileNamePattern() {
    return ;
  }
    return ;
  }
  public boolean isStarted() {
    return ;
  }
  public void start() {
     = true;
  }
  public void stop() {
     = false;
  }
  public void setParent(FileAppender appender) {
    this. = appender;
  }
  public boolean isParentPrudent() {
    return .isPrudent();
  }
    return .rawFileProperty();
  }
New to GrepCode? Check out our FAQ X