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 propertylogLevel
. 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 fileweblogic
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
| Specifies the date and time on which the record was written. Format (example): 2018-07-17 08:30:26.810+0100. |
| Specifies the identifier. |
| Message output by the resource adapter |
Example 25 Entries in the LogWriter file
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
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:
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
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