12-8 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server
could, however, use dye filtering to trigger TraceElapsedTimeAction only for requests that originated from user adminavitek.com at IP address 127.0.0.1.
1.
Configure the DyeInjection monitor so that USER1=adminavitek.com and ADDR1=127.0.0.1, and enable the DyeInjection monitor. For instructions, see
Configure diagnostic monitors in a diagnostic system module in the Oracle WebLogic Server Administration Console Help.
2.
Configure a dye mask and enable dye filtering for the Servlet_Before_Service diagnostic monitor. In the Administration Console:
a.
Add the Servlet_Around_Service monitor from the WLDF instrumentation library to your application as described in Configure instrumentation for
applications in the Oracle WebLogic Server Administration Console Help.
b. After adding the monitor, click Save on the Settings for application_name
page.
c. Click the Servlet_Around_Service link to display the Settings for Servlet_
Around_Service page.
d. Select the Enabled check box to enable the monitor.
e. Under Actions, move TraceElapsedTimeAction from the Available list to the
Chosen
list.
f. In the Dye Mask section, move USER1 and ADDR1 from the Available list to
the Chosen list. g.
Select the EnableDyeFiltering check box. h.
Click Save. 3.
Redeploy the application. Configurations added via the Administration Console are not persisted to the
weblogic-diagnostics.xml file in the applications META-INF directory or to the DIAG_ MODULE.xml file; they are saved in the applications deployment plan.
You can also manually update your DIAG_MODULE.xml file to add diagnostic monitors, as shown in
Example 12–2 , but this is not recommended. It is better to
change the configuration via the Administration Console on a running server. Any changes you make to DIAG_MODULE.xml will not take effect until you redeploy the
application.
Example 12–2 Sample Configuration for Using Dye Filtering in a Delegating Monitor, in
DIAG_MODULE.xml
wldf-resource nameMyDiagnosticModulename
instrumentation enabledtrueenabled
wldf-instrumentation-monitor nameDyeInjectionname
enabledtrueenabled propertiesADDR1=127.0.0.1 USER1=adminavitek.comproperties
wldf-instrumentation-monitor wldf-instrumentation-monitor
nameServlet_Around_Servicename dye-maskADDR1 USER1dye-mask
dye-filtering-enabledtruedye-filtering-enabled actionTraceElapsedTimeActionaction
wldf-instrumentation-monitor -- Other elements to configure instrumentation --
Configuring the DyeInjection Monitor to Manage Diagnostic Contexts 12-9
instrumentation -- Other elements to configure this diagnostic monitor --
wldf-resource
With this configuration, the TraceElapsedTimeAction action will be triggered for the Servlet_Around_Service diagnostic monitor only for those requests that originate from
IP address 127.0.0.1 and user adminavitek.com.
The flags that are enabled in the diagnostic monitor must exactly match the bits set in the requests dye vector for an action to be triggered and an event to be written to the
Event Archive. For example, if the diagnostic monitor has both the USER1 and ADDR1 flags enabled, and only the USER1 flag is set in the requests dye vector, no action will
be triggered and no event will be generated.
12.5 How Dye Masks Filter Requests to Pass to Monitors