Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1015

logback在tomcat默认工程中使用问题5

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 1.1.2
    • logback-core
    • apache-tomcat-7.0.47,jdk1.6

    Description

      导出war包部署在tomcat/webapps下,并设置为默认项目,<Context docBase="logbackweb" path="" reloadable="true"/>,结果发现logback配置中
      ----------------------------------------------------------------
      <appender name="FILE1" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <File>D:/cqinfo.log</File>
      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <maxIndex>100</maxIndex>
      <FileNamePattern>d:/cqinfo.log.%i</FileNamePattern>
      </rollingPolicy>
      <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
      <MaxFileSize>5MB</MaxFileSize>
      </triggeringPolicy>

      <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      <pattern>%d

      {yyyy-MM-dd HH:mm:ss.SSS}

      [%m] %n</pattern>
      </encoder>
      </appender>
      ----------------------------------------------------------------------
      5MB的控制失效了,有人遇到过么?
      看了下logback源码是在rename当前活动文件和当前活动文件.1文件时失败了,
      case NONE:
      util.rename(getActiveFileName(), fileNamePattern
      .convertInt(minIndex));
      break;
      有人遇到过这个问题么?有人解决了么?

      Attachments

        Activity

          People

            logback-dev Logback dev list
            shine1200 nyj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: