glassfish
  1. glassfish
  2. GLASSFISH-15350

Thread Id is coming different in server.log file

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1_ms07
    • Fix Version/s: 3.1_ms08
    • Component/s: logging
    • Labels:
      None
    • Environment:

      All Platform

      Description

      If user starts domain using following command

      ./asadmin start-domain --debug --verbose
      It starts domain properly with all required thread ids in logging message.

      On console user can see following message with Thread Id 60.
      [#|2010-12-27T11:20:28.114+0530|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=60;_ThreadName=Thread-25;|Binding RMI port to *:8686|#]

      [#|2010-12-27T11:20:28.705+0530|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=60;_ThreadName=Thread-25;|JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://naman:8686/jndi/rmi://naman:8686/jmxrmi|#]

      But when you open and see server.log file same messages is logged with different thread Id 17.
      [#|2010-12-27T11:20:28.114+0530|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=17;_ThreadName=Thread-1;|Binding RMI port to *:8686|#]

      [#|2010-12-27T11:20:28.705+0530|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=17;_ThreadName=Thread-1;|JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://naman:8686/jndi/rmi://naman:8686/jmxrmi|#]

        Activity

        Hide
        rajendra_inamdar added a comment -

        One way to handle this could be to create a custom LogRecord where additional contextual information can be stored. It can be put on the queue. This info can be used during formatting when the custom LogRecord is processed in the consumer thread.

        Show
        rajendra_inamdar added a comment - One way to handle this could be to create a custom LogRecord where additional contextual information can be stored. It can be put on the queue. This info can be used during formatting when the custom LogRecord is processed in the consumer thread.
        Hide
        rajendra_inamdar added a comment -

        Fix submitted:

        r55516 | rajendra.inamdar@oracle.com | 2012-08-16 13:34:31 -0700 (Thu, 16 Aug 2012) | 2 lines
        Changed paths:
        M /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/GFFileHandler.java
        A /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/GFLogRecord.java
        M /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/ODLLogFormatter.java
        M /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/UniformLogFormatter.java

        Fix incorrect thread-name in the server log records.

        Show
        rajendra_inamdar added a comment - Fix submitted: r55516 | rajendra.inamdar@oracle.com | 2012-08-16 13:34:31 -0700 (Thu, 16 Aug 2012) | 2 lines Changed paths: M /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/GFFileHandler.java A /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/GFLogRecord.java M /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/ODLLogFormatter.java M /trunk/main/nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/UniformLogFormatter.java Fix incorrect thread-name in the server log records.
        Hide
        Bobby Bissett added a comment -

        What is the status of this issue now that a patch was submitted? The incorrect thread names in the log file caused us a great deal of confusion on our project. If it helps, am attaching a test servet that shows the problem. Here is the output I see:

        Using GF 2.1.1-b31:

        Terminal output:
        [#|2012-10-05T09:58:12.998-0400|INFO|sun-appserver2.1|testLogger|_ThreadID=18;_ThreadName=bobby_test_thread;|Hi, I am bobby_test_thread|#]
        Log:
        [#|2012-10-05T09:58:12.998-0400|INFO|sun-appserver2.1|testLogger|_ThreadID=18;_ThreadName=bobby_test_thread;|Hi, I am bobby_test_thread|#]

        Using GF 3.1.2.2:

        Terminal output:
        [#|2012-10-05T10:02:06.340-0400|INFO|glassfish3.1.2|testLogger|_ThreadID=20;_ThreadName=bobby_test_thread;|Hi, I am bobby_test_thread|#]
        Log:
        [#|2012-10-05T10:02:06.340-0400|INFO|glassfish3.1.2|testLogger|_ThreadID=20;_ThreadName=Thread-3;|Hi, I am bobby_test_thread|#]

        Clearly, the log file record for GF 3.X should match the others.

        Show
        Bobby Bissett added a comment - What is the status of this issue now that a patch was submitted? The incorrect thread names in the log file caused us a great deal of confusion on our project. If it helps, am attaching a test servet that shows the problem. Here is the output I see: Using GF 2.1.1-b31: Terminal output: [#|2012-10-05T09:58:12.998-0400|INFO|sun-appserver2.1|testLogger|_ThreadID=18;_ThreadName=bobby_test_thread;|Hi, I am bobby_test_thread|#] Log: [#|2012-10-05T09:58:12.998-0400|INFO|sun-appserver2.1|testLogger|_ThreadID=18;_ThreadName=bobby_test_thread;|Hi, I am bobby_test_thread|#] Using GF 3.1.2.2: Terminal output: [#|2012-10-05T10:02:06.340-0400|INFO|glassfish3.1.2|testLogger|_ThreadID=20;_ThreadName=bobby_test_thread;|Hi, I am bobby_test_thread|#] Log: [#|2012-10-05T10:02:06.340-0400|INFO|glassfish3.1.2|testLogger|_ThreadID=20;_ThreadName=Thread-3;|Hi, I am bobby_test_thread|#] Clearly, the log file record for GF 3.X should match the others.
        Hide
        rajendra_inamdar added a comment -

        This issue is fixed in 4.0. As per SE advice, marking this one fixed and opened a bugdb issue.

        On 10/26/12 5:03 AM, manoj malhotra wrote:
        >
        > Hi All-
        >
        > SE works via bugdb only.
        > Open a bug in bugdb and let me know, I can target it for 3.1.2-patch#4.
        > Same (dev) engineer who has fixed bug for 4.0 need to backport it for SE tails.
        >
        > Kind Regards,
        > Manoj

        Show
        rajendra_inamdar added a comment - This issue is fixed in 4.0. As per SE advice, marking this one fixed and opened a bugdb issue. On 10/26/12 5:03 AM, manoj malhotra wrote: > > Hi All- > > SE works via bugdb only. > Open a bug in bugdb and let me know, I can target it for 3.1.2-patch#4. > Same (dev) engineer who has fixed bug for 4.0 need to backport it for SE tails. > > Kind Regards, > Manoj
        Hide
        Bobby Bissett added a comment -

        Is there any way I can get a patch (or pointer to the commit and I'll find the files) so I can rebuild my 3.1.2.2 with this change?

        Show
        Bobby Bissett added a comment - Is there any way I can get a patch (or pointer to the commit and I'll find the files) so I can rebuild my 3.1.2.2 with this change?

          People

          • Assignee:
            sandeep.shrivastava
            Reporter:
            naman_mehta
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2 hours
              2h
              Remaining:
              Remaining Estimate - 2 hours
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified