Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

LogWriter for connection factories

The application server provides LogWriters to which the BeanConnect resource adapter writes system level information on managed connection factories and managed connections when certain events occur. This information is intended for the application server administrator and is not intended for the diagnosis of problems in application programs.

Events and event classes

The events are subdivided into the following classes which comprise specific events:

  • Errors

  • Transactions:

    • Begin of a transaction for a connection

    • Commit/Rollback of a transaction for a connection

  • Lifecycle:

    • Generation of a managed connection

    • Request for a connection handle for a managed connection

    • Switch of a connection handle for a managed connection

    • Release of a connection handle and inclusion of the managed connection in the application server's connection pool

    • Removal of a managed connection from the application server's connection pool

    • Release of a managed connection

    • Application exceptions for a connection handle that are thrown to an application

    • System exceptions that are thrown for a managed connection

Configuring a LogWriter in the application server

In the case of Oracle WebLogic Server, you configure the LogWriter for a managed connection factory in the file weblogic-ra.xml as follows:

  • Logging level

    The logging level determines the granularity with which BeanConnect outputs messages on a managed connection factory at the LogWriter. In the case of the Oracle WebLogic Server, you configure the logging level in the file weblogic-ra.xml by specifying the property logLevel. This value can be set separately for each managed connection factory. There are four log levels: NONE, ERROR, INFO and ALL.

    For details, see Setting configuration properties for outbound communication via OSI-TP / LU6.2 and Setting the configuration properties for UPIC . You will find examples in Example 6 in Example: weblogic-ra.xml and Example 7 in Adapting connection pooling for UPIC .

  • Logging attributes

    You set further logging attributes in the subelement <logging>. You can find further details on the subelement <logging> in the schema description for the file weblogic ra.xml in the Oracle Weblogic Server documentation.

    Enter the path name of the file for the logging output in the attribute <log-filename>.

    You can enable or disable logging using the attribute <logging-enabled>.

    You can use other attributes to control, for example, the size to which a log file can grow or the maximum number of log files that can be created for a managed connection factory if file rotation is configured.

    Example

    <logging>
    	<log-filename>C:/temp/log/BeanConnect/echo.log</log-filename>
    	<logging-enabled>true</logging-enabled>
    	<rotation-type>bySize</rotation-type>
    	<number-of-files-limited>true</number-of-files-limited>
    	<file-count>3</file-count> 
    </logging>
    

    If you are dealing with different connection factories then you should specify different files. Otherwise, conflicts may occur when writing the files and the log records may be truncated.

Example

<connection-instance>
   <jndi-name>eis/beanconnect_oltp_echo</jndi-name>
   <connection-properties>
      <logging>
         <log-filename>C:/temp/log/BeanConnect/echo.log</log-filename>
         <logging-enabled>true</logging-enabled>
         <rotation-type>bySize</rotation-type>
         <number-of-files-limited>true</number-of-files-limited>
         <file-count>3</file-count>
      </logging>
      <properties>
         <property>
            <name>ConnectionURL</name>
            <value>oltp://echo</value>
         </property>
         <property>
            <name>displayName</name>
            <value>sample application/echo</value>
         </property>
         <property>
            <name>logLevel</name>
            <value>ALL</value>
         </property>
      </properties>
   </connection-properties>
</connection-instance> 

Format of the logging records

All the records that BeanConnect writes to the LogWriter have the following structure:

BeanConnect:<date-time> <identifier> message

<date-time>

Specifies the date and time on which the record was written. Format (example): 2018-07-17 08:30:26.810+0100.

<identifier>

Specifies the identifier.
In the case of a managed connection factory, this is the value configured in the DisplayName property of the file weblogic-ra.xml, see  Setting configuration properties for outbound communication via OSI-TP / LU6.2 and Setting the configuration properties for UPIC .
In the case of a managed connection, the identifier has the form BCUnnnnn, where each n stands for a digit.
In the case of a connection handle, the identifier has the form BCUnnnnn.i, where each n stands for a digit and i stands for a number.

message

Message output by the resource adapter


Example 25 Entries in the LogWriter file

  1. In the case of lifecycle events, the date, time and identifier of the managed connection are logged:
    BeanConnect:2018-07-17 08:30:51.225+0100 <sample application/echo>:
    Managed connection with id <BCU00002> destroyed

  2. In the case of events which refer to an exception, the exception is also logged:

    BeanConnect:2018-07-17 08:33:35.198+0100 <sample application/echo>: 
    rcvString(): Exception thrown for connection <BCU00003.2>: 
    net.fsc.jca.communication.EISConnectionException: 
    net.fsc.jca.communication.EISConnectionException: 
    exceptionShortageOfResources: shortage of resources (40Z,KD10): no 
    connection to partner; partner: (SMPOSICL,gssbwrit), Dialog, error code: 
    undefined error code [EC_UNDEFINED:0], connectionId: , error code: 
    undefined error code [EC_UNDEFINED:0], connectionId: BCU00003.2, proxy: 
    MYPROXY:30004/BCU30004, userId: BCU00003; diagnostic string:
    
  3. In the case of communications with transactions, six logging records are usually generated:

    BeanConnect:2018-07-17 08:30:27.138+0100 <sample application/echo>: 
    Managed connection with id <BCU00002> taken from pool
    BeanConnect:2018-07-17 08:30:27.138+0100 <sample application/echo>: 
    Connection handle with id <BCU00002.1> created
    BeanConnect:2018-07-17 08:30:27.653+0100 <sample application/echo>: 
    Transaction started for managed connection "BCU00002" with xid: 
    formatID=48801, gtrid=002157A9 D15A3057 A4BD, bqual=6569732F 6265616E 
    636F6E6E 6563745F 6F6C7470 5F656368 6F
    BeanConnect:2018-07-17 08:30:43.815+0100 <sample application/echo>: 
    Transaction committed for managed connection "BCU00002" with xid: 
    formatID=48801, gtrid=002157A9 D15A3057 A4BD, bqual=6569732F 6265616E 
    636F6E6E 6563745F 6F6C7470 5F656368 6F
    BeanConnect:2018-07-17 08:30:43.908+0100 <sample application/echo>: 
    Connection handle with id <BCU00002.1> released
    BeanConnect:2018-07-17 08:30:44.267+0100 <sample application/echo>: 
    Managed connection with id <BCU00002> returned for pooling 
    
  4. In the case of communication without transactions, four logging records are usually generated:

    BeanConnect:2018-07-17 08:50:41.117+0100 <sample application/echo>: 
    Managed connection with id <BCU00005> taken from pool
    BeanConnect:2018-07-17 08:50:41.117+0100 <sample application/echo>: 
    Connection handle with id <BCU00005.4> created
    BeanConnect:2018-07-17 08:50:53.753+0100 <sample application/echo>: 
    Connection handle with id <BCU00005.4> released
    BeanConnect:2018-07-17 08:50:54.112+0100 <sample application/echo>: 
    Managed connection with id <BCU00005> returned for pooling