Go to the % LR installation directory %/LoadRunner/include, modify the globals. h file, and add:
Char * filename = "D: // logfile.txt"; long file_stream;
File_open (char * file_name ){
If (file_stream = fopen (file_name, "A") = NULL ){
Lr_error_message ("cannot open % s", file_name );
Lr_output_message ("Open File % s", "error ");
Return-1;
}
}
File_close (char * file_name)
{
If (fclose (file_stream ))
Lr_error_message ("error closing file % s", filename );
Return 0;
}
Add: file_open (filename );
Add: fprintf (file_stream, "% s, bmsscmbn, mobileno/N", ctime (& T1) in action ));
Add: file_close (filename );
In this example, multiple vusers are started to execute the task in control. all the logs are exported to the logfile.txt on the d Drive.
Note: In if (file_stream = fopen (file_name, "A"), the second parameter needs to be written as "a". If it is written as "W", it will not be written in logfile.txt
Save all logs output when the virtual user executes. Only the log information of the last virtual user executed is saved.