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

logback is opening multiple files at the same time for same appender.

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.11
    • logback-core
    • OS : AIX machine

      Application server : Weblogic server

    Description

      Issue:

      I see multiple same log files opened for logging,

      [root@cssapp2 rtc]# lsof | grep rtc-connector.log

      java       2989 cbsuser  787w      REG               0,19  5273861    2923670 /IPmeas/cssapp2/rtc/rtc-connector.log.3 (172.17.71.97:/ibm/logfs)

      java       2989 cbsuser  815w      REG               0,19  3822121     483571 /IPmeas/cssapp2/rtc/rtc-connector.log (172.17.71.97:/ibm/logfs)

      [root@cssapp2 rtc]#

      The above rtc-connector.log.3 is above 5 MB even though it is configured as <MaxFileSize>5MB</MaxFileSize>. Actually it is not released from writing and so the size keeps increasing.

      I have mentioned the current appender configuration below.

      Kindly help to resolve it.

      Jars:

      WEB-INF/lib/logback-ext-spring-0.1.1.jar

      WEB-INF/lib/logback-classic-1.0.11.jar

      WEB-INF/lib/logback-core-1.0.11.jar

       

      Configuration:

      Issue is with rtc_file_appender. It is writing in more than one rtc-connector.log file.****

      <?xml version="1.0" encoding="UTF-8"?>

       

      <configuration scan="true" scanPeriod="30 seconds" debug="false" >

      <contextName>rtc</contextName>

      <newRule pattern="*/configuration/extendedJmxConfigurator" actionClass="com.comverse.api.framework.log.jmx.logback.ExtendedJMXConfigurationAction"/>

      <extendedJmxConfigurator/>

      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">

      <encoder>

      <Pattern>%date | [%.-1level] | %logger | %X{threadId} | %X{username} | %X{username} | %X{uniqueClientId} | tid:%X{transaction_id} | acc:%X{account_id} | sub:%X{subscriber_id} | ord:%X{order_number} | soid:%X{service_order_number} | %msg%n</Pattern>

      </encoder>

      </appender>

       

      <appender name="rolling_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">

      <!-- **** File name must match SAPILOGNAME value in Install.properties **** -->

      <File>/IPmeas/${HOSTNAME}/rtc/SingleApi.log</File>

      <Append>true</Append>

      <encoder>

      <Pattern>%date | [%.-1level] | %logger | %X{threadId} | %X{loggedUserName} | %X{username} | %X{uniqueClientId} | tid:%X{transaction_id} | acc:%X{account_id} | sub:%X{subscriber_id} | ord:%X{order_number} | soid:%X{service_order_number} | %msg%n</Pattern>

      </encoder>

      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">

      <maxIndex>50</maxIndex>

      <FileNamePattern>/IPmeas/${HOSTNAME}/rtc/SingleAPI.log.%i</FileNamePattern>

      </rollingPolicy>

      <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">

      <MaxFileSize>5MB</MaxFileSize>

      </triggeringPolicy>

      </appender>

       

      <!-- CSS specific appenders -->

       

      <appender name="rtc_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">

      <File>/IPmeas/${HOSTNAME}/rtc/rtc-connector.log</File>

      <Append>true</Append>

      <encoder>

      <Pattern>%date | [%.-1level] | %logger | %X{threadId} | %X{loggedUserName} | %X{username} | %X{uniqueClientId} | tid:%X{transaction_id} | acc:%X{account_id} | sub:%X{subscriber_id} | ord:%X{order_number} | soid:%X{service_order_number} | %msg%n</Pattern>

      </encoder>

      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">

      <maxIndex>50</maxIndex>

      <FileNamePattern>/IPmeas/${HOSTNAME}/rtc/rtc-connector.log.%i</FileNamePattern>

      </rollingPolicy>

      <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">

      <MaxFileSize>5MB</MaxFileSize>

      </triggeringPolicy>

      </appender>

       

      <appender name="async_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">

      <File>/IPmeas/${HOSTNAME}/async/async-connector.log</File>

      <Append>true</Append>

      <encoder>

      <Pattern>%date | [%.-1level] | %logger | %X{threadId} | %X{loggedUserName} | %X{username} | %X{uniqueClientId} | tid:%X{transaction_id} | acc:%X{account_id} | sub:%X{subscriber_id} | ord:%X{order_number} | soid:%X{service_order_number} | %msg%n</Pattern>

      </encoder>

      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">

      <maxIndex>50</maxIndex>

      <FileNamePattern>/IPmeas/${HOSTNAME}/async/async-connector.log.%i</FileNamePattern>

      </rollingPolicy>

      <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">

      <MaxFileSize>5MB</MaxFileSize>

      </triggeringPolicy>

      </appender>

       

      <logger name ="central.logger" level="debug">

      <appender-ref ref="rtc_file_appender" />

      </logger>

       

      <root level="debug" />

      Attachments

        Activity

          People

            logback-dev Logback dev list
            karthika KARTHIKA RAGUPATHI
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: