Purpose
Use LogEvent to
identify a variable or constant that is of interest, and write the
value to a file.
Description
Use LogEvent
to identify a variable or constant that is of interest and write the
value to a file. You can use LogEvent to monitor the values of variables
at various stages of application execution to help diagnose problems
with a state table. LogEvent can capture the values of multiple variables
if the values have been concatenated to a single variable. Use AssignData
to concatenate multiple values.
What LogEvent does with the
event information depends on whether you define the event as a system
event, a private event, or both:
- When an event is a system event, LogEvent sends the event to the
system management component of Blueworx Voice Response, for
inclusion in the Event Report, which is described in the Blueworx Voice Response for AIX:
Configuring the System information. The Event Name that appears in
the Event Report is the first 16 characters of the System
Event parameter that you specify when you define the
action.
- When an event is a private event, LogEvent writes the information
to a log file for your use. The log file is a flat ASCII file in $CUR_DIR/oamlog.
The suffix is .log. Name the log file as described
in Naming a private event log file.
Refer to theBlueworx Voice Response for AIX:
Configuring the System information for information about viewing logged
events.
Naming a private event log file
There are two ways
to identify the log file: either use the default name assigned by Blueworx Voice Response or provide
your own name as part of the information to be logged:
- Default file names are constructed as follows:
Appl.application_name.log
where application_name is
the name of the state table named in the application profile. For
example, if the state table is named MainOne, each time LogEvent is
used, the event is written to the file named Appl.MainOne.log.
Note: When
you use the state table debugger to debug a state table that contains
a LogEvent action, the name of the log file that is created by default
is Appl.ST-Debug.log.
- To use your own file name, you need to include the string FILE=filename: (where filename is
the name of the file) as the first part of the Private
Event parameter. You can use all the standard file name
characters for your file name, with the exception of the space. File
names can be up to 27 characters in length, and are truncated if longer. colon
(:) marks the end of the file name and is followed by the
value of the parameter. The action automatically appends the .log suffix.
For example, suppose you want to log the constant begin as
a private event and you want the file to be called pin01.
The value of Private Event would be:
FILE=pin01:begin
Each
time LogEvent is used, the constant begin is written
to the file named pin01.log.
To log the value
of a variable in a file that you name yourself, you have to create another variable
using the AssignData action. For example,
AssignData
Operator ==> Concatenate
Operand1 ==> 'FILE=pin01:'
Operand2 ==> pin_num
Result ==> log_pin_num
Then specify log_pin_num as
the variable in the LogEvent action.
Note: The log file is stored
on the Blueworx Voice Response system
on which you start the file. In a single system image, this means
there can be separate log files on each client. If you want to look
at log information for the complete single system image, you must
look at the log files for all the clients.
Parameters
The parameters
for LogEvent identify the variables or constants of interest and define
the events that involve them as system events, private events, or
both.
- System Event. Identifies the variable
or constant to be logged.
- Private Event. Identifies the variable
or constant to be logged. If you want to give the log file a specific
name, the value also includes the name.
Possible results
- Succeeded
- The value of the variable or constant has been logged.
- Invalid Event
- The value of the specific variable or constant identified cannot
be logged.
- Host Problem
- The value could not be logged due to a system problem.
ASCII syntax
When using an ASCII editor, code this action with these parameters in the following order:
- The variable or constant to be logged as a system event, or the
constant VAR_UNDEFINED
- The variable or constant to be logged as a private event, or the
constant VAR_UNDEFINED.
For example, to log the variable in3_s as a system event
only:
label: "Check Edges"
LogEvent(in3_s, VAR_UNDEFINED)
edge EDGE_LOG_SUCCESSFUL: successful
edge EDGE_LOG_INVALID_EVENT: invalid_event
edge EDGE_LOG_HOST_PROBLEM: host_problem
;
The parameters and edges are described above, in
"Parameters" and "Possible results". For more information, see Testing a state table using the debugger.