In LoadRunner IS the a way turn the log level on and off all only for part of the script?

  • Questions
  • In LoadRunner IS the a way turn the log level on and off all only for part of the script?
Question ID: 105077
3
0

My scripts are really big. if I try to use the all RTS log options for "extended logs" (Parameter Substitution, Data returned by server, Advance trace) the script hangs and timeouts before it get to the fail point.

I like to turn on the full logs at action line 876 and run for a few events and the turn off . At line 900

thanks

Marked as spam
Posted by (Questions: 218, Answers: 15)
Asked on July 22, 2013 4:19 pm
24 views
Answers (2)
3
Private answer

Turning LOGS ON AND OFF FROM WITHIN THE SCRIPT

Script step 1

Script step 2

Script step 3

Script step n...

/*to up level of logging to */

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG| LR_MSG_CLASS_RESULT_DATA | LR_MSG_CLASS_PARAMETERS, LR_SWITCH_ON);

OR

/* Or for full trace */

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG | LR_MSG_CLASS_FULL_TRACE, LR_SWITCH_ON );

Script step n+1

Script step n+2

Script step n+3

/* Now reset message class to former level */

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG|LR_MSG_CLASS_PARAMETERS, LR_SWITCH_OFF);

OR

/* Or for full trace */

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG | LR_MSG_CLASS_FULL_TRACE, LR_SWITCH_OFF );

Rest of Script

******Remember to remove or comment out before run in controller

Marked as spam
Posted by (Questions: 12, Answers: 363)
Answered on July 22, 2013 4:25 pm
2
Private answer

/* This turns on all logging */
lr_set_debug_message( LR_MSG_CLASS_EXTENDED_LOG |
LR_MSG_CLASS_FULL_TRACE|
LR_MSG_CLASS_PARAMETERS|
LR_MSG_CLASS_RESULT_DATA,
LR_SWITCH_ON );

/* This turns that log level off */
lr_set_debug_message( LR_MSG_CLASS_EXTENDED_LOG |
LR_MSG_CLASS_FULL_TRACE|
LR_MSG_CLASS_PARAMETERS|
LR_MSG_CLASS_RESULT_DATA,
LR_SWITCH_OFF );

Marked as spam
Posted by (Questions: 4, Answers: 41)
Answered on July 22, 2013 6:28 pm