[logback-user] Log File Last Modified Not Changing

Scott Malinowski scottm1969 at yahoo.com
Tue Apr 14 21:01:51 CEST 2009


I found a wierd error that may be a bug (or I could be doing something stupid).

I can see that records are being added to my log file but the last modified date/time is not changing. The timestamp is set to when the server came up and that is it. It never changes again. I can see this in Windows Explorer but this is also true via Java when using File.lastModified(), the value returned is always the same.

Has anyone else seen this? I'm setting ImmediateFlush to true and when I look at the log file in TextPad, I am prompted to refresh everytime a new message is logged so I know the log file is being updated.

I'm using Windows XP, WebLogic 9.1, and JDK 1.5.

Thanks,
Scott

Here is my config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--
  1) Parameterized logging methods (quicker than calling isEnabled if it is enabled)
  2) Already has built-in duplicate logging check (one line in config file)
  3) Real-time logging configuration changes via JMX (in JDK 1.6)
-->
  <!-- log file for WARN and above messages -->
  <appender name="ERRORLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <Append>true</Append>
    <ImmediateFlush>true</ImmediateFlush>
    <File>/var/log/iperms/uci/error.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%-31(%-23date{MM-dd-yyyy HH:mm:ss.SSS} [%-5level]) %-17mdc{Process} \(%class.%method:%line\) %msg%n</Pattern>
    </layout>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>WARN</level>
    </filter>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <MaxHistory>30</MaxHistory>
      <FileNamePattern>/var/log/iperms/uci/error.%d.log</FileNamePattern>
    </rollingPolicy>
  </appender>
  <!-- log file for INFO and above messages -->
  <appender name="INFOLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <ImmediateFlush>true</ImmediateFlush>
    <Append>true</Append>
    <File>/var/log/iperms/uci/info.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%-31(%-23date{MM-dd-yyyy HH:mm:ss.SSS} [%-5level]) %-17mdc{Process} \(%class.%method:%line\) %msg%n</Pattern>
    </layout>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>INFO</level>
    </filter>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <MaxHistory>30</MaxHistory>
      <FileNamePattern>/var/log/iperms/uci/info.%d.log</FileNamePattern>
    </rollingPolicy>
  </appender>
  <!-- log file for all messages -->
  <appender name="VERBOSELOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <File>/var/log/iperms/uci/verbose.log</File>
    <ImmediateFlush>true</ImmediateFlush>
    <Append>true</Append>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%-31(%-23date{MM-dd-yyyy HH:mm:ss.SSS} [%-5level]) %-17mdc{Process} \(%class.%method:%line\) %msg%n</Pattern>
    </layout>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <MaxHistory>30</MaxHistory>
      <FileNamePattern>/var/log/iperms/uci/verbose.%d.log</FileNamePattern>
    </rollingPolicy>
  </appender>
  <!-- log file for image processing messages -->
  <appender name="IMAGE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <ImmediateFlush>true</ImmediateFlush>
    <File>/var/log/iperms/uci/image.log</File>
    <Append>true</Append>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%-31(%-23date{MM-dd-yyyy HH:mm:ss.SSS} [%-5level]) %-17mdc{Process} \(%class.%method:%line\) %msg%n</Pattern>
    </layout>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <MaxHistory>30</MaxHistory>
      <FileNamePattern>/var/log/iperms/uci/image.%d.log</FileNamePattern>
    </rollingPolicy>
  </appender>
  <!-- log file for SQL statements -->
  <appender name="SQL" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <Append>true</Append>
    <File>/var/log/iperms/uci/sql.log</File>
    <ImmediateFlush>true</ImmediateFlush>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%-31(%-23date{MM-dd-yyyy HH:mm:ss.SSS} [%-5level]) %-17mdc{Process} \(%class.%method:%line\) %msg%n</Pattern>
    </layout>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <MaxHistory>30</MaxHistory>
      <FileNamePattern>/var/log/iperms/uci/sql.%d.log</FileNamePattern>
    </rollingPolicy>
  </appender>
  <!-- log to STDOUT (console) -->
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%date [%thread] %-5level %logger{36} - %msg%n</Pattern>
    </layout>
  </appender>

  <!-- set loggers up with appenders -->
  <logger name="DEFAULT" additivity="false" level="DEBUG">
    <appender-ref ref="ERRORLOG" />
    <appender-ref ref="INFOLOG" />
    <appender-ref ref="VERBOSELOG" />
  </logger>
  <logger name="IMAGE" additivity="false" level="INFO">
    <appender-ref ref="IMAGE" />
  </logger>
  <logger name="SQL" additivity="false" level="INFO">
    <appender-ref ref="SQL" />
  </logger>
  <!--  need to handle external packages -->
  <logger name="org.hibernate.connection.UserSuppliedConnectionProvider" level="ERROR" />
  <logger name="org" level="WARN" />
  <logger name="org.apache.commons.httpclient" level="ERROR" />
  <logger name="httpclient" level="ERROR" />

  <root level="debug">
    <appender-ref ref="STDOUT" />
  </root>
</configuration>



      



More information about the Logback-user mailing list