Comparing System-Scoped to Application-Scoped Instrumentation

11-12 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server

11.5.1 Comparing System-Scoped to Application-Scoped Instrumentation

Instrumenting an application is similar to instrumenting at the system level, but with the following differences: ■ Applications can use standard, delegating, and custom monitors. – The only server-scoped standard monitor is DyeInjection. The only application-scoped standard monitor is HttpSessionDebug. For more information, see the entry for HttpSessionDebug in Section B.1, Diagnostic Monitor Library. – Delegating monitors are either server-scoped or application-scoped. Applications must use the application-scoped delegating monitors. – All custom monitors are application-scoped. ■ The servers instrumentation settings affect the application. In order to enable instrumentation for an application, instrumentation must be enabled for the server on which the application is deployed. If server instrumentation is enabled at the time of deployment, instrumentation will be available for the application. If instrumentation is not enabled on the server at the time of deployment, enabling instrumentation in an application will have no effect. ■ Application instrumentation is configured with a weblogic-diagnostics.xml descriptor file. You create a META-INFweblogic-diagnostics.xml file, configure the instrumentation, and put the file in the applications archive. When the archive is deployed, the instrumentation is automatically inserted when the application is loaded. ■ You can use a deployment plan to dynamically update configuration elements without redeploying the application. See Section 14.2, Using Deployment Plans to Dynamically Control Instrumentation Configuration. The XML descriptors for application-scoped instrumentation are defined in the same way as for server-scoped instrumentation. You can configure instrumentation for an application solely by using the delegating monitors and diagnostic actions available in the WLDF Instrumentation Library. You can also create your own custom monitors; however, the diagnostic actions that you attach to these monitors must be taken from the WLDF Instrumentation Library. Table 11–5 compares the function and scope of system and application diagnostic modules. Table 11–5 Comparing System and Application Modules Module Type Add or Remove Objects Dynamically Add or Remove Objects with Console Modify with JMX Remotely Modify with JSR-88 non-remote Modify with Console EnableDisable Dye Filtering and Dye Mask Dynamically System Module Yes Yes Yes No Yes via JMX Yes Application Module Yes, when hot-swap is enabled No, when hot-swap is not enabled: module must be redeployed Yes No Yes Yes via plan Yes Configuring Instrumentation 11-13

11.5.2 Overview of the Steps Required to Instrument an Application