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

After rolling logback writes to the old and the new file (rolls-over twice)

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.7, 1.2.3
    • logback-core
    • Linux 2.6.32-696.el6.x86_64
      Grails 3 application on tomcat 8.0.32

    Description

      After rolling (without zipping) logback continues to log some threads to the old logfile and some to the new logfile.
      With statusListener(OnConsoleStatusListener) in logback.groovy I can see that the roll-over occurs twice.

      (For this test we used hourly rolling on our development sever. Normally we use daily logging)

       17:00:02,500 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Elapsed period: Thu Nov 09 16:57:30 CET 2017
      17:00:02,501 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [logs/jdbc-iom.log] to [logs/jdbc-iom.log.2017-11-09-16]
      17:00:02,507 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - first clean up after appender initialization
      17:00:04,099 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Elapsed period: Thu Nov 09 16:56:22 CET 2017
      17:00:04,100 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [logs/jdbc-iom.log] to [logs/jdbc-iom.log.2017-11-09-16]
      17:00:04,104 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - first clean up after appender initialization

      When rolling and zipping (what we actually use)  the second rol-over gives an error since the zip file already exists and leaves the .tmp file. After this, logback logs some theads to the new file and other threads to the xxx.tmp file.

       

      lsof shows thats both the new and old files are used:

      java 652 isle-of-man 67r REG 253,0 232853 17366 /opt/tomcat-instances/isle-of-man/logs/jdbc-iom.log.2017-11-09-16
      java 652 isle-of-man 69r REG 253,0 234119 17364 /opt/tomcat-instances/isle-of-man/logs/jdbc-iom.log

       

      Orignially I saw this behaviour with logback 1.1.7.  I forced grails to use logback 1.2.3 with the same result. 

       

      Attachments

        Activity

          People

            logback-dev Logback dev list
            Merlijn Merlijn van der Mee
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: