Title
Filter EM monitoring activities in the Apache log to reduce access_log size

Date
2006-11-06

Summary
This procedure provides instructions for configuring Apache log filtering for for Oracle 9iAS. This drastically reduces entries in the access_log due to self monitoring by EM.

Details
1. Shutdown OHS:
dcmctl stop -v -ct ohs

2. Edit $ORACLE_HOME/Apache/Apache/conf/httpd.conf and replace the 1 single line with the 6 lines:

Old entry:
CustomLog logs/access_log common

New entry:
#CustomLog logs/access_log common
SetEnvIf Request_URI "^\/dmsoc4j\/Spy" noLog
SetEnvIf Request_URI "^\/dms0\/Spy" noLog
SetEnvIf Request_URI "^\/oprocmgr-service" noLog
SetEnvIf Request_Method "(HEAD)" noLog
CustomLog logs/access_log common env=!noLog

3. Edit $ORACLE_HOME/dcm/config/plugins/apache/apache.xsd, search for the following section, and insert the line in red:
<complexType name="AccessLogType">
  <attribute name="LogFile"   type="string"     use="required"/>
  <attribute name="Env"       type="string"     use="optional"/>
  <attribute name="Format"    type="string"     use="required"/>
  <attribute name="Key"       type="apache:keyset" use="fixed" value="LogFile Format"/>
</complexType>

4. Edit $ORACLE_HOME/dcm/config/plugins/apache/modDirectiveMS.xsd, search for the following section, and insert the text in red in the appropriate location:
<group name="MSIfModule_SETENVIF_Content">
  <sequence>
    <element name="BrowserMatch"       type="string" minOccurs="0" maxOccurs="unbounded"/>
    <element name="BrowserMatchNoCase" type="string" minOccurs="0" maxOccurs="unbounded"/>
    <element name="SetEnvIf"           type="string" minOccurs="0" maxOccurs="unbounded"/>
    <element name="SetEnvIfNoCase"     type="string" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</group>

5. Update the DCM configuration and startup up OHS:
dcmctl updateconfig -ct ohs -v -d
dcmctl start -v -ct ohs

Applicable Versions
Oracle Application Server 9i
Ahmed Aboulnaga

.com .com