8 Understanding Logging

This chapter contains the following topic:

8.1 Logging

You use log files to troubleshoot system behavior. The location of the business service and published business service log files is defined in the jdelog.properties file under <pathcode>/ini/bssv. The default location of these log files is <pathcode>/bssv/log, which you can change.

8.1.1 Default Logging

The business service foundation provides default logging behavior. When startInternalMethod(IContext context, String methodName, ValueObject internalVO) is called, the following information is automatically written in the log file:

22 Aug 2006 22:25:24,125 [Line ?] [DEBUG ]  - [BSSVFRAMEWORK]    
[Context ID: 141.144.96.127:1907:1156307000656]    startInternalMethod() 
executed for addAddressBook 
22 Aug 2006 22:25:24,140 [Line ?] [DEBUG ]  - [BSSVFRAMEWORK]    
[Context ID: 141.144.96.127:1907:1156307000656]    ValueObject for 
addAddressBook: 
=============================================
ValueObject oracle.e1.bssv.J0100010.valueobject.InternalAddAddressBook:
InternalPhones[0]: 
=============================================
ValueObject oracle.e1.bssv.J0100030.valueobject.InternalPhone:
   SzPhoneNumber: 444-5555
   SzPhoneAreaCode: 303
   SzPhoneNumberType: HOM
=============================================
InternalPhones[1]: 
=============================================
ValueObject oracle.e1.bssv.J0100030.valueobject.InternalPhone:
   SzPhoneNumber: 444-1555
   SzPhoneAreaCode: 303
   SzPhoneNumberType: 02
=============================================
InternalPhones[2]: 
=============================================
ValueObject oracle.e1.bssv.J0100030.valueobject.InternalPhone:
   SzPhoneNumber: 444-1655
   SzPhoneAreaCode: 303
   SzPhoneNumberType: HOM
=============================================
   SzTaxId: 11655018
   SzCountry: US
   SzState: CO
   SzCounty: Arapahoe
   SzCity: Denver
   SzPostalCode: 80807
   SzAddressLine4: Line 4
   SzAddressLine3: Line 3
   SzAddressLine2: Line 2
   SzAddressLine1: 223 W. Teller Ave
   SzMailingName: Green Tracy18
   MnAddressBookNumber: 0
   SzLongAddressNumber: 165346418
   JdDateEffective: Mon Sep 04 22:23:20 MDT 2006
   SzBusinessUnit:           30
   SzVersion: XJDE0001
   SzSearchType: E
   SzAlphaName: Tracy, Green18

8.1.2 Explicit Logging

You can use this code to provide explicit logging in the business service:

      //RI: call to logger - log the beginning of the business service method 
processing using app ID 
       context.getBSSVLogger().app(context,
                  "@@@@@@Begin call for BSSV AddressBookProcessor.
addAddressBook",
                  "\n",
                  internalVO.toString(),
                  null)
       ...
   }

Many logging methods exist for signifying APP, DEBUG, WARN, or SEVERE conditions. Plain text as well as exceptions can be passed as parameters to these methods for inclusion in the logs.

This information is logged into the jas.log file as a result of the preceding sample code:

17 Jul 2006 16:53:51,125 [Line ?] [APP   ]  - [oracle.e1.foundation.util.
IBSSVLogger]
       [Context ID: 10.139.87.66:2751:1153176823468]    
       @@@@@@Begin call for BSSV AddressBookProcessor.addAddressBook