Tutorial about TraceOn, Trace, and TraceOff in Siebel.
The methods of TraceOn, Trace, and TraceOff are often useful for developers to troubleshoot and track a script during run time. These methods, however, should be used judiciously.
Summary
Developers should note the following key items when using the TraceOn, Trace, and TraceOff methods.
1. Always use TraceOff with TraceOn in Siebel
TraceOn will activate the tracing for the behavior of the application according to the parameters specified in the TraceOn method. However, the tracing will not be automatically turned off when the script completes or aborts. The trace will continuously log the SQL, allocation information, or both until the application is shut down. This will make the analysis of the log file more difficult due to the amount of unrelated information that may be included. Refer to the example in Siebel Visual Basic (VB) code below:Sub … TheApplication.TraceOn ”C:\trace.txt”, ”SQL”, ”” … if … then TheApplication.TraceOff exit sub end if … TheApplication.TraceOff End SubThe above code demonstrates that once a TraceOn is issued in a procedure, TraceOff must be called before every exit of this procedure.
2. Isolate the issue
If the issue is known to be happening in specific lines of code of, it is a good practice to use TraceOn and TraceOff around the specific issue point. This allows the information gathered in trace file to be focused on the issue and reduces the amount of unrelated information in the trace file.For example, if it is known that a script’s query cannot find the desired record, the requirement is to analyze the SQL that is generated in the script. The focus should be on the script that sends the query. In Siebel VB, this may appear as:
TheApplication.TraceOn ”C:\trace.txt”, ”SQL”, ”” oBC.ExecuteQuery TheApplication.TraceOffHere TraceOn and Traceoff log only for the one suspect line “oBC.ExecuteQuery”.
Thus only the SQL that is generated in this script will be recorded, streamlining the analysis.
3. The trace file is overwritten in each round of testing
If the FileName parameter specified in the TraceOn method is not found on the specific drive, a new file is created. However, if the file already exists then the TraceOn method will overwrite the existing one. Therefore, if the result of a previous test needs to be referenced later, rename the trace file to avoid it being overwritten.4. Important: The trace file is generated in different locations
The trace file is generated in different locations depending on which script interface is used. The general rule is that for interfaces that do not rely on the Siebel Server, the trace file is generated in the local machine. For interfaces that have to connect to Siebel Server, the trace file is generated on the Siebel Server machine.a. The Interfaces that generate a trace on the local machine
- Server Script when using Dedicated Client or Mobile Web Client
- COM Data Server
- COM Data Control in Local mode
- Mobile or Dedicated Web Client Automation Server
- Server Script when using Web Client or Standard Interactive Client
- COM Data Control in Server mode
- Siebel Java Data Bean
- Siebel CORBA Object Manager
No comments :