[GLASSFISH-18522] server.log has 44.0 as what looks like the product name and version Created: 16/Mar/12  Updated: 20/Dec/12  Resolved: 20/Dec/12

Status: Resolved
Project: glassfish
Component/s: logging
Affects Version/s: None
Fix Version/s: 4.0_b68_EE7MS3

Type: Bug Priority: Major
Reporter: Cheng Fang Assignee: sandeep.shrivastava
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I noticed in 4.0 server.log, it has 44.0 as what looks like the product
name and version, for example,

[#|2012-03-12T15:01:43.931-0400|INFO|44.0|javax.enterprise.system.jmx.org.glassfish.admin.mbeanserver|_ThreadID=18;_ThreadName=Thread-2;|JMX002:
JMXStartupService: Stopped JMXConnectorServer: null|#]

whereas in 3.1.2, the same column has glassfish3.1.2:

[#|2012-03-12T14:22:07.444+0000|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=13;_ThreadName=Thread-2;|Grizzly
Framework 1.9.46 started in: 43ms - bound to [0.0.0.0:3700]|#]

I usually look at this column to see which version of glassfish the log
belongs to. Any idea why 44.0, instead of 4.0 or glassfish4.0?



 Comments   
Comment by Joe Di Pol [ 12/Dec/12 ]

re-assigning to logging

Comment by sandeep.shrivastava [ 18/Dec/12 ]

In the prior release the version field used to be glassfish3.1.2, see log record example below.

[#|2012-12-18T12:28:42.036-0500|INFO|glassfish3.1.2|javax.enterprise.system.jmx.org.glassfish.admin.mbeanserver|_ThreadID=43;_ThreadName=Thread-2;|JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://adc6260176.us.oracle.com:8686/jndi/rmi://adc6260176.us.oracle.com:8686/jmxrmi|#]

The code in the UniformLogFormatter which build the string is as follows:

protected String getProductId()

{ String version = Version.getAbbreviatedVersion() + Version.getVersionPrefix() + Version.getMajorVersion() + "." + Version.getMinorVersion(); return (version); }

In the Version class, the abbreviated version is being returned as the major version, hence the major version is repeated twice.

/**

  • Returns abbreviated version.
    */
    public static String getAbbreviatedVersion() { return getMajorVersion(); }

The UniformLogFormatter can instead call the Version.getAbbrevProductName() method.

Index: src/main/java/com/sun/enterprise/server/logging/UniformLogFormatter.java
===================================================================
— src/main/java/com/sun/enterprise/server/logging/UniformLogFormatter.java (revision 57623)
+++ src/main/java/com/sun/enterprise/server/logging/UniformLogFormatter.java (working copy)
@@ -177,7 +177,7 @@
*/
protected String getProductId()

{ - String version = Version.getAbbreviatedVersion() + Version.getVersionPrefix() + + String version = Version.getAbbrevProductName() + Version.getVersionPrefix() + Version.getMajorVersion() + "." + Version.getMinorVersion(); return (version); }

With the fix the log record appears as the following:

[#|2012-12-18T12:50:53.335-0500|INFO|glassfish4.0|javax.enterprise.system.jmx|_ThreadID=29;_ThreadName=Thread-5;_TimeMillis=1355853053335;_LevelValue=800;_MessageID=AS-JMX-00005;|JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://adc6260176.us.oracle.com:8686/jndi/rmi://adc6260176.us.oracle.com:8686/jmxrmi|#]

Comment by sandeep.shrivastava [ 20/Dec/12 ]

This should be fixed with r57727.

Generated at Thu Feb 11 17:47:52 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.