4 Configuring and Capturing Diagnostic Images

You use the Diagnostic Image Capture component of the WebLogic Diagnostic Framework (WLDF) to create a diagnostic snapshot, or dump, of a server's internal runtime state at the time of the capture. This information helps support personnel analyze the cause of a server failure.

The following topics describe the Diagnostic Image Capture component:

How to Initiate Image Captures

A diagnostic image capture can be initiated by:

Configuring Diagnostic Image Captures

Because the diagnostic image capture is meant primarily as a post-failure analysis tool, there is little control over what information is captured. Available configuration options are:

  • The destination for the image

  • For a specific capture, a destination that is different from the default destination

  • A lockout, or timeout, period, to control how often an image is taken during a sequence of server failures and recoveries

As with other WLDF components, you can configure Diagnostic Image Capture using the Administration Console (see "Configure and capture diagnostic images" in the Oracle Fusion Middleware Oracle WebLogic Server Administration Console Help), the WebLogic Scripting Tool (WLST), or programmatically.

Example 4-1 shows an example of WLST commands for generating an image capture.

Example 4-1 Sample WLST Commands for Generating a Diagnostic Image

url='t3://localhost:7001'
username='system'
password='gumby1234'
server='myserver'
timeout=120
connect(username, password, url)
serverRuntime()
cd('WLDFRuntime/WLDFRuntime/WLDFImageRuntime/Image')
argTypes = jarray.array(['java.lang.Integer'],java.lang.String)
argValues = jarray.array([timeout],java.lang.Object)
invoke('captureImage', argValues, argTypes)

Note:

TIt is often useful to generate a diagnostic image capture when a server fails. To do so, set a watch rule to evaluate to true when the server's state changes to FAILED; then associate an image notification with the watch.

The watch rule is as follows:

(${[weblogic.management.runtime.ServerRuntimeMBean]//State} = 'FAILED')

For more information, see Configuring Harvester Watches and Configuring Image Notifications. Also see "Configure Watches and Notifications" in the Oracle Fusion Middleware Oracle WebLogic Server Administration Console Help.

How Diagnostic Image Capture Is Persisted in the Server's Configuration

The configuration for Diagnostic Image Capture is persisted in the config.xml file for a domain, under the <server-diagnostic-config> sub-element of the <server> element for the server, as shown in Example 4-2:

Example 4-2 Sample Diagnostic Image Capture Configuration

<domain>
  <!-- Other domain configuration elements -->
  <server>
    <name>myserver</name>
    <server-diagnostic-config>
      <image-dir>logs\diagnostic_images</image-dir>
      <image-timeout>2</image-timeout>
    </server-diagnostic-config>
    <!-- Other configuration details for this server -->
  </server>
  <!-- Other server configurations in this domain-->
</domain>

Note:

Oracle recommends that you do not edit the config.xml file directly.

Contents of the Captured Image File

The most common sources of a server state are captured in a diagnostic image capture, including:

  • Configuration

  • Log cache state

  • Java Virtual Machine (JVM)

  • Work Manager state

  • JNDI state

  • Most recent harvested data

The Diagnostic Image Capture component captures and combines the images produced by the different server subsystems into a single ZIP file. In addition to capturing the most common sources of the server state, this component captures images from all the server subsystems including, for example, images produced by the JMS, JDBC, EJB, and JNDI subsystems.

Note:

A diagnostic image is a heavyweight artifact meant to serve as a server-level state dump for the purpose of diagnosing significant failures. It enables you to capture a significant amount of important data in a structured format and then to provide that data to support personnel for analysis.

Each image is captured as a single file for the entire server. The default location is SERVER\logs\diagnostic_images. Each image instance has a unique name, as follows:

    diagnostic_image_DOMAIN_SERVER_YYYY_MM_DD_HH_MM_SS.zip

The contents of the file include at least the following information:

  • Creation date and time of the image

  • Source of the capture request

  • Name of each image source included in the image and the time spent processing each of those image sources

  • JVM and OS information, if available

  • Command line arguments, if available

  • WLS version including patch and build number information

Figure 4-1 shows the contents of an image file. You can open most of the files in this ZIP file with a text editor to examine the contents.