View Single Post
Old 10-27-2020, 09:43 AM
Rhudi's Avatar
Rhudi Rhudi is offline
Registered User
Join Date: Jul 2013
Location: Greenville, SC
Posts: 93
Custom Log Data not working

I have a script that works very well to establish AdHoc connections to devices. This script has an added bonus of trying SSH, then TELNET. Once either of those is connected, I have code as follows (all variables are properly defined):
            Select Case bConnected
                Case True ' Connected
                    UserName = env("USERNAME")
                    UserProf = env("USERPROFILE")
                    objTab.Caption = strConnectType & strShortHostName
                    crt.Session.SetStatusText("Connected: " & strConnectType & strShortHostName)
                      Set objTab = crt.GetScriptTab
                      Set objConfig = objTab.Session.Config
                      objConfig.SetOption "Custom Log Message Each Line", "%h:%m:%s | "                    
                    crt.Session.LogFileName =  UserProf & "\SecureCRT Logs\" & UserName & "\%Y-%M-%D.%h.%m - " & strShortHostName & " -- (" & UserName & ").log"
                    crt.Session.Log True
                Case False ' Not Connected
                    crt.Dialog.MessageBox "Try again later:" & vbCrLf & strShortHostName
            End Select
The problem is, this line has no visible impact:
objConfig.SetOption "Custom Log Message Each Line", "%h:%m:%s | "

I do get my log file in the specified folder, but the lines have no time stamp.

I am using:
Version 8.3.4 (x64 build 1699) - Official Release - July 12, 2018
and have no ability to upgrade.

Last edited by Rhudi; 10-27-2020 at 10:30 AM. Reason: minor correction