dynamic tracing

  

Virtual Machine  

Dynamic Tracing is a comprehensive feature that is built to examine the behavior of your PROIV application. You can use this as a system administrator or application developer, and is suitable for use with live production systems.

This will allow you to explore your system to understand how it works, track down performance problems across many layers of your application or locate the cause of aberrant behavior.

It allows you to turn tracing ON/OFF programmatically for the session; in case you set the tracing  configuration in the session, it will persist only for that session and does not affect any other active sessions. However, if the tracing configuration is not defined in the session, the tracing configuration from the pro4v8.ini file will take effect.

DYNAMIC TRACING METHODS FOR SESSION LEVEL:

You can set the tracing for the current session using the session object methods in the logic editor. The following are the session object methods which you can use programmatically to set the tracing mechanism as per your business requirement.

SESSION.GetTraceCfg("parameter name")

GetTraceCfg() - retrieves the values from the pro4v8.ini or previously set by the SetTraceCfg() method in the current session. The following are the valid values for the argument:

  • TR_PATH  

  • TR_MAX_FILE_SIZE

  • TR_MAX_FILES_PER_VM

Examples:

Session.GetTraceCfg("TR_PATH") - Returns the tracing path set for the current session as string

Session.GetTraceCfg("TR_MAX_FILE_SIZE") - Returns the maximum trace file size set for current session as string

Session.GetTraceCfg("TR_MAX_FILES_PER_VM") - Returns the maximum number of tracing files allowed per session as a number

SESSION.GetTraceLevel("functional area")

GetTraceLevel() - retrieves the level of tracing set for the functional area specified in argument for current session.

Following are the valid functional areas:

TRACEALL, TRACEIO, TRACEREC, TRACEBLK, TRACELGC, TRACEREP, TRACECRT, TRACEMAT, TRACERTC, TRACEDAEMON TRACEMEM, TRACESER, TRACEENV, TRACEMFIN, TRACESLT, TRACEFILE, TRACEMFOUT, TRACESQL, TRACEGEN, TRACEMISC TRACETASK, TRACEGUI, TRACEPRP, TRACEUSER, TRACEUSRTB TRACEPPM

Example:

SESSION.GetTraceLevel("TRACEPPM")

SESSION.SetTraceCfg("parameter name", value)

 

 

SetTraceCfg() - Sets the tracing configuration parameters for the session. The following are the valid parameters:

  • TR_PATH - sets the path as retrieved from the PROIV session.

  • TR_MAX_FILE_SIZE - sets the file size for the trace log file in the PROIV session.

  • TR_MAX_FILES_PER_VM - sets the maximum number of trace log files for the session.

Examples:

Session.SetTraceCfg("TR_PATH", "C:\proivtrace2\")   - Sets the tracing path for the current session

Session.SetTraceCfg("TR_MAX_FILE_SIZE", 10) - Sets the maximum allowed tracing file size for current session.

Session.SetTraceCfg("TR_MAX_FILES_PER_VM",5) - Sets the maximum allowed trace files for current session. The unit is specified in Megabytes.

Session.SetTraceCfg("TR_PATH", "") - sets the trace path to blank. This will stop the tracing for current session.

SESSION.SetTraceLevel("functional area", tracelevel)

SESSION.SetTraceLevel("functional area", tracelevel)

Sets the trace level for the functional area specified as the first argument to the value specified as second argument.

The following are valid functional areas:

TRACEALL, TRACEIO, TRACEREC, TRACEBLK, TRACELGC, TRACEREP, TRACECRT, TRACEMAT, TRACERTC, TRACEDAEMON TRACEMEM, TRACESER, TRACEENV, TRACEMFIN, TRACESLT, TRACEFILE, TRACEMFOUT, TRACESQL, TRACEGEN, TRACEMISC TRACETASK, TRACEGUI, TRACEPRP, TRACEUSER, TRACEUSRTB, TRACEPPM

The valid range for second argument "tracelevel" is 0-15. Any value out of range will be set to default. If the trace level set is less than 0, then it will default to 0. If the trace level set is greater than 15, then it will default to 15

Examples:

SESSION.SetTraceLevel("TRACEPPM", 10)

SESSION.SetTraceLevel("TRACEPPM", 0)

 

Example - TO SWITCH ON DYNAMIC TRACING PROGRAMMATICALLY IN LOGIC EDITOR

You can set the tracing configuration using tracing APIs in the logic editor.

  1. Open PROIV function and then the logic editor.

  2. Use the code snippet as shown in the following snapshot.

To stop tracing, use the code snippet as shown in the following snapshot.
Note: Tracing is automatically turned OFF for a particular session upon EXIT.

Output: When the function is executed, the trace log files are created at the specified path, with maximum file size and maximum number of files.

 

Comment on this topic

Topic ID: 750073

Table of Contents

Index

Glossary

-Search-

Back