• No results found

Tracing a Client Request

In document Oracle troubleshooting (Page 43-49)

Practices for Lesson 5 Practices Overview

Practice 5-2: Tracing a Client Request

Duration: 40 minutes Skills Learned

At the end of this practice, you should be able to:

• Enable server debug messages

• Use context IDs to associate log entries with a request

• Configure a Dye Injection monitor

• Filter recorded events by using dye masks Overview

When instrumentation is enabled on a diagnostic module, all WLDF events and log entries associated with a client request will be tagged with a unique context ID. These IDs allow administrators to trace all the diagnostic data for a specific request.

In some troubleshooting cases, you may wish to go a step further and limit the conditions under which WLDF events are recorded. A diagnostic context ID supports various flags or “dyes” that allow you to filter the types of requests that trigger instrumentation data.

In this practice, you use the console to locate context IDs and try to map them to specific MedRec application functionality. You also use this opportunity to experiment with the dye injection monitor and dye masks. The lab infrastructure is shown in the following diagram:

Instructions

1. Generate debug messages in the server log.

a. If your domain does not include a diagnostic module, complete the Solution Instructions for the “Configuring and Monitoring Diagnostic Events” practice.

b. Launch the console and Lock it.

c. Locate and edit MedRecSvr1.

d. Click the Debug tab.

e. Locate the weblogic > servlet > internal debug scope.

Oracle University and Sentra inversiones y servicios LTDA use only

f. Select the check box for the internal scope and click the Enable button.

g. Similarly, enable the weblogic > ejb > invoke debug scope.

h. Activate your changes.

2. View context IDs for WLDF records.

a. Launch a second browser window and access the MedRec application:

http://localhost:7021/medrec/index.action b. Under the Patient section, click the Login link.

c. Log in as the user [email protected]/weblogic. Leave this browser session open.

d. Return to the console and view EventsDataArchive for MedRecSvr1.

e. Click Customize this table.

f. Add the Context ID column to the chosen list, if not already chosen. Click Apply.

g. Locate the Context ID for the latest event generated by your custom DebugPatientService monitor. For example:

Tip: To avoid scrolling, under Customize this table you may want to reorder the columns so that Context ID and Class are displayed adjacently.

h. Copy the last set of non-zero digits. In the example above, that would be “1e58c”.

3. Correlate WLDF and server log messages.

a. Use the console to view the ServerLog for MedRecSvr1.

b. Once again, add the Context ID column to the chosen list of columns. Also increase the Number of Rows Displayed Per Page to 1000.

c. Browse the recent log entries. Notice that some entries have been assigned context IDs while others have not. The latter are internal messages not associated with a client request.

d. Click Customize this table again.

e. For WLDF Query Expression, enter the following:

CONTEXTID LIKE '%nnnnn'

For nnnnn, paste the context ID fragment that you copied from the WLDF event.

Tip: If you do not see any entries, click Customize this table again and change Time Interval to Last 15 minute(s) (or longer).

Oracle University and Sentra inversiones y servicios LTDA use only

f. Click Apply.

g. Browse all the server debug messages associated with this login request. The Subsystem column should indicate “Http,” “HttpSessions,” and “EjbInvoke.”

h. Using these log messages, try to answer the following question: Upon logging into the MedRec application, what is the name of the JSP file that executes?

i. Return to the MedRec application. Click the Successfully logged in! Click here to continue link. Then click one of the listed patient Records.

j. Note the URL in the browser and the current time.

k. Access the server log again and view the latest entries. You must remove your custom log filter criteria.

l. Search the Web page contents for the text “viewRecordSummary.” Try to determine the context ID for the latest MedRec client request.

m. Once again, use the WLDF Query Expression field to show only those log messages for this context ID. Browse the contents of these messages.

n. Edit your MedRecSvr1 configuration again and Disable all debug attributes.

Tip: You can use the check box in the table header to select all other check boxes at once.

4. Configure the dye injection monitor to flag an IP address.

a. Obtain the IP address of your Linux VM instance. From a Linux terminal, execute:

/sbin/ifconfig.

Tip: If your VM is bound to multiple IP addresses, you can use the previously generated debug messages to determine the actual IP being used. It is probably the first one listed. If you use the wrong one you will have to repeat these instructions and try the other ones.

Oracle University and Sentra inversiones y servicios LTDA use only

b. Return to the console and Lock it.

c. Locate and edit your system diagnostic module, MedRecDiagnostics.

d. Click the Configuration > Instrumentation tab.

e. Click the Add/Remove button.

f. Move the DyeInjection monitor from the Available column to the Chosen column.

Click OK.

g. Edit the new monitor.

h. Under Properties, enter the following:

ADDR1=your_IP_address i. Click Save. Activate your changes.

5. Configure dye filtering for a monitor.

a. Lock the console again.

b. Edit the medrec application.

c. Click the Configuration > Instrumentation tab.

d. Click Add Monitor from Library.

e. Add the monitor Servlet_Before_Session and click OK.

f. Edit the new monitor. Enter or select the following values:

Field Value

Enabled <checked>

Actions (Chosen) TraceAction EnableDyeFiltering <checked>

Dye Mask (Chosen) ADDR1 Click Save.

g. Update the medrec application. Activate your changes.

6. Test event filtering.

a. Retest the MedRec application as done previously.

b. Return to the console and view EventsDataArchive for MedRecSvr1.

c. Using the Monitor column, confirm that events were recorded from the Servlet_Before_Session monitor.

Tip: If the events are not shown, try setting the dye flag to another available IP address.

d. Edit the MedRecDiagnostics module and select the DyeInjection monitor.

e. Edit this monitor’s Properties. Change the ADDR1 flag to use some other arbitrary IP address.

Tip: Alternatively, use another student’s IP address.

f. Update the medrec application. Activate your changes.

g. Test the application a final time.

h. In the admin console, view the latest event data. Using the records’ timestamps, verify that there are no new events from the Servlet_Before_Session monitor.

i. When you are finished with the practice, edit MedRecDiagnostics and disable the instrumentation component.

Oracle University and Sentra inversiones y servicios LTDA use only

Solution Instructions

1. If the <LAB_WORK>/domains/MedRecDomain location does not yet exist, follow the Solution Instructions for the “Developing a Custom Monitoring Script” practice.

2. Launch the Lab Framework command shell by executing the

<STUDENT>/bin/prompt.sh file.

3. Change the current directory to <CURRENT_LAB>.

4. Execute the following:

ant setup_solution The Lab Framework:

− Makes a backup copy of your current work

− Runs the solution for the “Configuring and Monitoring Diagnostic Events” practice

− Disables debug flags, if enabled

− Adds a new dye injection monitor to the WLDF module

− Deploys the MedRec application by using an updated deployment plan Note that all WLDF components will be disabled by default.

Note that the dye injection monitor will be configured with a dummy IP address.

Oracle University and Sentra inversiones y servicios LTDA use only

Oracle University and Sentra inversiones y servicios LTDA use only

In document Oracle troubleshooting (Page 43-49)