Created On:  22 October 2010

Problem:

  • Product Name: VisiBroker
  • Product Version: 7.0 and above
  • Product Component: logging
  • Platform/OS Version: All
  • JDK/Compiler Version: Al

How to leverage on VisiBroker logging framework to print out exception details, minor codes and completion status?

Resolution:

VisiBroker provides both for Java and C APIs to the internal logging, and the exception classes provide methods to access the exception details. How they can be used to log the exception details is shown in the attached example. The example is based on the poa/server_engine_policy example delivered with the VisiBroker installation. In the Server.C/Server.java file the property vbroker.se.mySe.scm.scmlist.listener.port can be changed to a port which is already in use by another application, which will cause an error to be thrown. The implementation of the catch will write the exception details both to stderr and to the VisiBroker logging.

C :

The logging library for the C ORB is vdlog.  It is documented in the VisiBroker help chapter “VisiBroker Logging”.  The usage is demonstrated in the “Debugging VisiBroker for C application” example.  In this example, the VISDEFLOGS macro is used.  A CORBA::Exception has a name property, a CORBA::SystemException is derived from it and has an additional minor code and completed status property.


The example shows how to access the exception details and write them to the VisiBroker log using vdlog


Server –ORBpropStorage server.properties

 

Java:

The implementation of the logging in Java ORB uses Log4J.  An API provides access to the logging. java.lang.Exception provides the method printStackTrace to print the exception details.

The example shows how to use the com.inprise.vbroker.Logging package to write the exception details to the VisiBroker log.

vbj –DORBpropStorage=server.properties Server

Incident #2480359