A Tangled Web

http://blogs.sun.com/mwhite/date/20081115 Saturday November 15, 2008

Open ESB Logging

Extensive logging capabilities are available in Open ESB v2 to help diagnose runtime problems and to help a component developer diagnose problems within a component. This discussion describes what logging facilities are available in the JBI runtime and how to control the levels of the various loggers. For a detailed look at the logging support for JBI components, please see my blog entry here.



JBI Runtime Logging


The JBI runtime has separately controllable loggers for its various sub-components to allow diagnosis at a fine-grained level without generating excessive amounts of logging output. There is also a top-level logger, com.sun.jbi, which is the parent of all of the sub-component loggers. The first time the runtime is initialized, the top-level logger defaults to a level of INFO, and all sub-component loggers have their levels set to null so that they inherit their levels from the top-level logger. Any logger levels that are set thereafter are always persisted so that they are restored after a restart of the runtime. There is a special logger level, DEFAULT, recognized by the runtime, that resets a logger level to null so that it reverts to inheriting its level from its parent logger. This is supported by the admin console, asadmin, and asant.


Here is a list of the main runtime loggers:



  • com.sun.jbi - the top-level logger for the entire runtime

  • com.sun.jbi.framework - core runtime, includes the startup and shutdown processing, all interactions directly with the JBI SPIs implemented by installed Binding Components and Service Engines, and all class loading management in the runtime

  • com.sun.jbi.management - all management processing

  • com.sun.jbi.management.AdminService - the administrative service responsible for bootstrapping the management system for all other system services, starting and stopping the the rmanagement services, and providing information that remote clients use to access system services and components

  • com.sun.jbi.management.ConfigurationService - the configuration service which provides configuration support for the runtime and for all Binding Components and Service Engines

  • com.sun.jbi.management.DeploymentService - the deployment service which provides support for deployment of Service Assemblies into the runtime

  • com.sun.jbi.management.InstallationService - the installation service which provides support for installation of Binding Components, Service Engines, and Shared Libraries

  • com.sun.jbi.management.LoggingService - the logging service which provides a lookup mechanism for logger MBeans

  • com.sun.jbi.messaging - the Normalized Message Router where all message exchange processing is performed


Controlling Runtime Loggers


Every runtime logger has a logger MBean which provides all of the operations necessary to manage the logger level. The administrative clients use these MBeans to perform all logger level setting. Here are examples showing how to manage runtime logger levels using asadmin. The following command is used to list the levels of all of the runtime loggers:


open1[66]% asadmin show-jbi-runtime-loggers
com.sun.jbi = INFO
com.sun.jbi.framework = INFO
com.sun.jbi.management = INFO
com.sun.jbi.management.AdminService = INFO
com.sun.jbi.management.ConfigurationService = INFO
com.sun.jbi.management.DeploymentService = INFO
com.sun.jbi.management.InstallationService = INFO
com.sun.jbi.management.LoggingService = INFO
com.sun.jbi.messaging = INFO
Command show-jbi-runtime-loggers executed successfully.


Suppose you want to change the the framework logger level to WARNING. The following command will do that:


open1[67]% asadmin set-jbi-runtime-logger "com.sun.jbi.framework=WARNING"
Command set-jbi-runtime-logger executed successfully.


Listing the loggers again you can see the framework logger level has changed:


open1[68]% asadmin show-jbi-runtime-loggers
com.sun.jbi = INFO
com.sun.jbi.framework = WARNING
com.sun.jbi.management = INFO
com.sun.jbi.management.AdminService = INFO
com.sun.jbi.management.ConfigurationService = INFO
com.sun.jbi.management.DeploymentService = INFO
com.sun.jbi.management.InstallationService = INFO
com.sun.jbi.management.LoggingService = INFO
com.sun.jbi.messaging = INFO
Command show-jbi-runtime-loggers executed successfully.


Now let's see how the logger level inheritance works. The following command will set the top-level logger level to FINE:


open1[69]% asadmin set-jbi-runtime-logger "com.sun.jbi=FINE"
Command set-jbi-runtime-logger executed successfully.


Note that the framework logger level has already been explicitly set, but all other loggers are still inheriting from the top-level logger:


open1[70]% asadmin show-jbi-runtime-loggers
com.sun.jbi = FINE
com.sun.jbi.framework = WARNING
com.sun.jbi.management = FINE
com.sun.jbi.management.AdminService = FINE
com.sun.jbi.management.ConfigurationService = FINE
com.sun.jbi.management.DeploymentService = FINE
com.sun.jbi.management.InstallationService = FINE
com.sun.jbi.management.LoggingService = FINE
com.sun.jbi.messaging = FINE
Command show-jbi-runtime-loggers executed successfully.


Suppose you want to change the framework logger to once again inherit its level from the top-level logger. Simply set its logger level back to DEFAULT:


open1[71]% asadmin set-jbi-runtime-logger "com.sun.jbi.framework=DEFAULT"
Command set-jbi-runtime-logger executed successfully.


Now the framework logger level is inheriting the last level set on its parent, the top-level runtime logger:


open1[72]% asadmin show-jbi-runtime-loggers
com.sun.jbi = FINE
com.sun.jbi.framework = FINE
com.sun.jbi.management = FINE
com.sun.jbi.management.AdminService = FINE
com.sun.jbi.management.ConfigurationService = FINE
com.sun.jbi.management.DeploymentService = FINE
com.sun.jbi.management.InstallationService = FINE
com.sun.jbi.management.LoggingService = FINE
com.sun.jbi.messaging = FINE
Command show-jbi-runtime-loggers executed successfully.


Now here's an example using the GlassFish admin console. The screen shots are of only the frame that is relevant, not the entire browser window, just to cut down on the size. This is the display of the runtime loggers and their levels:


Admin Console JBI runtime logger screen


Clicking on the drop-down list of logger levels for the Framework logger gives this:


Logger level drop-down list


Clicking on the FINE level in the drop-down results in this output. However, the actual logger level is not changed until the Save button is clicked:


Framework logger level to be set


After clicking on the Save button, the Framework logger level is changed:


Framework logger level updated

GlassFish ESB Release Candidate 1 available for download

We've reached a major milestone in our work on GlassFish ESB. The first release candidate, RC1, is now available for download.

RC1 includes a lot of improvements and bug fixes compared with Milestone 2. A list of these improvements will be posted shortly in the release notes.

Unless major issues are found in this release candidate, the next drop will be the GA release itself. This is planned for December 5.

A word of thanks to everyone involved, including those who downloaded Milestone 2 and provided feedback. Please download RC1, and see if issues that you may have reported earlier indeed have been fixed. If there are new issues, please indicate if you think if they are show stoppers for the GA release. Feedback can be posted on the users mailing list.