Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-17-2020, 08:57 AM
Rhudi's Avatar
Rhudi Rhudi is offline
Registered User
 
Join Date: Jul 2013
Location: Greenville, SC
Posts: 90
ad-hoc session 'Custom log data'?

Is it possible to set "Custom log data" ('On each line') using VB?

I know how to create a log file (and even append if needed).

Currently, I do things like this (variables are set appropriately):
Code:
crt.Session.LogFileName =  UserProf & "\SecureCRT Logs\" & UserName & "\%Y-%M-%D.%h.%m - " & strShortHostName & " -- (" & UserName & ").log"
crt.Session.Log True
In other code that works, I can create/write a file that has my "Connect Banner" (Which is a bit more detailed than what is provided in logfile options).
Then, close that file and use it as a LogFileName with 'append'.
When I'm done, I close the LogFile, then open 'ForAppending' to write my custom disconnect footer.

The only option I'd really like is to be able to set through VB is "On each line".
  #2  
Old 09-17-2020, 10:14 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,448
Hi Rhudi,

What version of SecureCRT are you using?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
  #3  
Old 09-17-2020, 10:45 AM
Rhudi's Avatar
Rhudi Rhudi is offline
Registered User
 
Join Date: Jul 2013
Location: Greenville, SC
Posts: 90
Version 8.3.4 (x64 build 1699) - Official Release - July 12, 2018

I am not able to upgrade.
  #4  
Old 09-17-2020, 11:23 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,448
Hi Rhudi,

Please see SecureCRT's documentation regarding SessionConfiguration object in the Scripting / Script Objects Reference topic in the Help file.

The specific line in your session (or Default session if making an ad hoc connection) INI file is:
S:"Custom Log Message Each Line"=

So, you would use something like below to add a timestamp:
Code:
Set objTab = crt.GetScriptTab
Set objConfig = objTab.Session.Config
objConfig.SetOption "Custom Log Message Each Line", "%h:%m:%s -- "
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Closed Thread


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 05:14 PM.