Search This Blog

Tuesday, March 06, 2007

ECID's for the OC4J and Apache in 10.1.3

For enabling the ECID's with the OC4J logs , please use the following method.

1. cd $ORACLE_HOME/Apache/Apache.conf
% cp httpd.conf httpd.conf.orig

Edit "httpd.conf" and locate the current "LogFormat"
directive for the "common" log:

LogFormat "%h %l %u %t \"%r\" %>s %b" common

Duplicate and then comment this entry, then edit the duplicate
to include the following log attributes:

(a) "[ecid: %{Oracle-ECID}i]" (logs the ECID)
(b) "[%T (secs)]" (logs time taken to process the request)

For example:


#
#LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%h %l %u %t [ecid: %{Oracle-ECID}i] \"%r\" %>s %b [%T (secs)]"
#


2. Backup and then edit the OPMN configuration file
($ORACLE_HOME/opmn/conf/opmn.xml):

Edit Rfa Line:13
       % cd $ORACLE_HOME/opmn/conf
% cp opmn.xml opmn.xml.orig

Edit "opmn.xml" and add "-Doracle.dms.transtrace.ecidenabled=true"
to the "java-options" element of the "start-parameters" of the entries
for the desired OC4J instance :


/>

3. Backup and then edit cnfiguration file for the OC4J web site.
($ORACLE_HOME/j2ee//config/default-web-site.xml):

% cd $ORACLE_HOME/j2ee/home/config
% cp default-web-site.xml default-web-site.xml.orig

Edit "default-web-site.xml" and add "[ecid: $header:Oracle-ECID]"
as an additional parameter to the format attribute of the
tag:

path="../log/default-web-access.log"
format="$ip ($user) [ecid: $header:Oracle-ECID] "$request" $status $size"
/>

Remove the entry split="day"

and for your application you need to have the attribute access-log="true" ,
i.e.


With this you will get the ECID's in the default-web-access.log and in the
access_log of the Apache. Please also have the debug option in the httpd.conf file.

If you have the [$time] option then you will not get any entries because of the
Bug 5170989 ARRAYINDEXOUTOFBOUNDSEXCEPTION WHEN ACCESS-LOG IS CONFIGURED