Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-06-2010, 03:31 AM
samoki samoki is offline
Registered User
 
Join Date: Jun 2006
Posts: 24
How can I get log file name?

I write some codes,somewhere,I want to get session log file name,but crt does not return me the right answer.
Code:
Dim tmpGetLogFileName,tmpGetLogStatus,tmpLogState
tmpGetLogStatus = crt.Session.Logging
tmpGetLogFileName = crt.Session.LogFileName
MsgBox "LogFileName:" &tmpGetLogFileName
MsgBox "LogFileName from SCRT:" &crt.Session.LogFileName
Session.Logging work right,Session.LogFileName do not return null.
The crt version is 5.1.
Please help me!

Last edited by samoki; 01-06-2010 at 03:35 AM.
Reply With Quote
  #2  
Old 01-06-2010, 11:32 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,633
Hello Samoki,

The code for displaying the filename results in the message box references the Property instead of the variable you stored the result in.

If I understand correctly what you are trying to do, change your code to the following:
Code:
Dim tmpGetLogFileName, tmpGetLogStatus
tmpGetLogStatus = crt.Session.Logging
tmpGetLogFileName = crt.Session.LogFileName
MsgBox "LogStatus:" & tmpGetLogStatus
MsgBox "LogFileName from SCRT:" & tmpGetLogFileName
If you make the above change, do you get the logging status and log filename displayed in message boxes?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-06-2010, 07:55 PM
samoki samoki is offline
Registered User
 
Join Date: Jun 2006
Posts: 24
Quote:
Originally Posted by bgagnon
Hello Samoki,

The code for displaying the filename results in the message box references the Property instead of the variable you stored the result in.

If I understand correctly what you are trying to do, change your code to the following:
Code:
Dim tmpGetLogFileName, tmpGetLogStatus
tmpGetLogStatus = crt.Session.Logging
tmpGetLogFileName = crt.Session.LogFileName
MsgBox "LogStatus:" & tmpGetLogStatus
MsgBox "LogFileName from SCRT:" & tmpGetLogFileName
If you make the above change, do you get the logging status and log filename displayed in message boxes?
Thanks.The codes you give me,I have tested.
When I write a short script to test these sentences,it can work correctly.
But when I move these codes to my program,the sentence
Code:
MsgBox "LogFileName from SCRT:" & tmpGetLogFileName
give me nothing.
Reply With Quote
  #4  
Old 01-07-2010, 10:31 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,633
Hello samoki,

I would need to know more about the complete script in order to help.
  • Are you using a pre-configured/saved session to connect?
  • Does the session configuration have a log file defined, or are you turning on logging manually from the File menu?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

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 01:59 AM.