CompositeRollingAppender.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:cacheonix-core 作者:
/**
 * Creates and opens the file for logging.  If <code>staticLogFileName</code>
 * is false then the fully qualified name is determined and used.
 */
public synchronized void setFile(String fileName, boolean append) throws IOException {
    if (!staticLogFileName) {
        scheduledFilename = fileName = fileName.trim() + sdf.format(now);
        if (countDirection > 0) {
            scheduledFilename = fileName = fileName + '.' + (++curSizeRollBackups);
        }
    }

    super.setFile(fileName, append);
    if(append) {
      File f = new File(fileName);
      ((CountingQuietWriter) qw).setCount(f.length());
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号