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

Internal logback threads with same name created at server startup

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.7
    • logback-core
    • Linux

      application deployed on apache tomcat

    Description

      Scenario:

      I have a web application written in java. The application is deployed on multiple linux servers on apache tomcat(version 8.0.41). I am using springboot starter managed logback.

      Spring version: 1.3.5.RELEASE

      this version internally manages 1.7.1 version of logback. My logback file has timebased as well as sizebased policy set. 

      Issue: I am observing a sporadic issue on few servers where log file breaks into two at random time. The weird part is that the file that gets rolled over has last day's date(instead of today's date) and future logs keep getting written to this rolled file instead of the new file that is created.

       

      Observation: I connected my application with visualvm and saw that two internal threads of logback are created with the same name. I have attached a screenshot from visualvm showing two threads with logback-1 name and two threads named logback-2. Ideally this should not happen because "Threads created internally by logback are now named logback-n, where n is an integer. For the first thread n is set to 1, for each successive thread n is incremented by 1."(ref: https://logback.qos.ch/news.html).

      I have a hunch that somehow logback is misbehaving to create two threads at server startup.

      For notice: This is not happening across all the servers. This is sporadic. Also, All our servers have equal load balancing in place. 

      Attachments

        1. logback.jpg
          94 kB
          Kirti Singh
        2. logback-spring.xml
          3 kB
          Kirti Singh

        Activity

          People

            logback-dev Logback dev list
            kirtisi Kirti Singh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: