Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-12-2009, 03:41 AM
samoki samoki is offline
Registered User
 
Join Date: Jun 2006
Posts: 24
How to record session to defferent log files when script is running?

I want to record session to different log files,one record session,some special output need to record to another log file.Can I change log file when script is running?How can I carry out it?
Reply With Quote
  #2  
Old 08-12-2009, 11:32 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,635
Hi samoki,

You can include logging to two separate files in your script. Assuming logging is currently set to 'True' to log the session, you would need to perform the following steps:
  1. Stop logging to "old_logfile"
  2. Save "old_logfile" filename in a variable
  3. Specify a new filename for the logging of the "special output"
  4. Start logging to "new_logfile"
  5. Issue the desired command for which you wish to capture the "special output"
  6. Stop logging to "new_logfile"
  7. If desired, restart logging to "old_logfile"
The code snippet would look similar to below:
Code:
crt.Session.Log False
strOrigLogFile = crt.Session.LogFileName
crt.Session.LogFileName = "C:\new_logfile.txt"
crt.Session.Log True, True
crt.Screen.Send "desired command"
crt.Screen.WaitForString "my prompt"
crt.Session.Log False
crt.Session.LogFileName = strOrigLogFile
crt.Session.Log True, True
Using the above information, are you able to log to two separate files?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 08-12-2009, 05:54 PM
samoki samoki is offline
Registered User
 
Join Date: Jun 2006
Posts: 24
Thanks.I'll try it.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:58 AM.