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 02-26-2018, 12:55 PM
Hang Hang is offline
Registered User
 
Join Date: Jul 2016
Posts: 20
Unable to log session

Hi I keep getting this error message when I run my script. I can write to folder that this file is save to, I have full write and read access, I only have one session open.

https://pasteboard.co/H9tiZhr.png <-- image
in case this get taken down: The message was "Unable to open log file: log123.log. Access is denied.


It works at one point and I play around with some session options and now it doesn't log anymore. If I do it manually it works, file-> log session.

Side question: Is there a way to reload the default SecureCRT config instead of uninstalling the whole program and reinstalling it? I don''t know what I change and don't see anywhere, where I can put all the config back to default.

Thanks,

Last edited by Hang; 02-26-2018 at 03:34 PM.
Reply With Quote
  #2  
Old 02-26-2018, 02:53 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,937
Hi Hang,

What version of SecureCRT are you using?

On what OS?

Quote:
Hi I keep getting this error message when I run my script. I can write to folder that this file is save to, I have full write and read access, I only have one session open.
So you are setting the log location via a script. Is that correct?

If so, it does not appear it is a fully-qualified path (or you would see that in the error message). What folder are you checking the permissions on?


Quote:
Side question: Is there a way to reload the default SecureCRT config instead of uninstalling the whole program and reinstalling it? I don''t know what I change and don't see anywhere, where I can put all the config back to default.
There's no built-in location for logging, so I am not sure reverting to a default config will solve this problem.

The Global.ini file is where SecureCRT gets the info for Global Options. However, every session has its own INI file (ie: Session Options). New sessions use Default.ini (in the Sessions subfolder of the config folder) as the template.

The location of your installation's Configuration folder is found in the General / Configuration Paths category of SecureCRT's Global Options.

(In fact, uninstalling/reinstalling usually will not reload a default config, because that info is in the configuration folder, not the installation folder.)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 02-26-2018, 03:32 PM
Hang Hang is offline
Registered User
 
Join Date: Jul 2016
Posts: 20
I am running Version 8.1.4 (build 1443) on win7 x64.

Yes, I am setting the log location via script.
Code:
TestLog = currentTab.Session.LogFileName = "Test123.log"		
currentTab.Screen.Synchronous = True
currentTab.Session.Log(True)
..
CODE
..
currentTab.Session.Log(False)
The folder I am checking for permission on is the same folder where all my scripts are located, it is also the default folder where my log file is saved to. Like I was saying earlier this did work for me a week ago, it just start giving me this error message last Friday.

Anyways, I got it working again. After your comment about the path not being qualified. I went into the session options->Terminal->Log File and then browse for the folder where it supposed to be saved in and delete the file name just leaving the path to the folder and that works. FYI, the folder is already set properly to where I wanted to save my file.

The weird thing is that if I go back the Log File menu I don't see the path that was set it, only the file name like how it was when it didn't work. Basically everything is the same.

Long story short. I just had to reset where the file should be save in the Log File menu and everything works again.

Thanks for your help.
Reply With Quote
  #4  
Old 02-26-2018, 04:02 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,937
Hi Hang,

The Log Session from File menu brings up a window that allows you to select the location by browsing for it. So the fully-qualified path is created by you drilling down through folders. This is a different mechanism than setting a path via the LogFileName property.

Quote:
The folder I am checking for permission on is the same folder where all my scripts are located, it is also the default folder where my log file is saved to.
There is not presently a default location for log files.

I have added this thread to a feature request in our product enhancement database to have a default log file location for unqualified log paths. Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct email notification, send an email to support@vandyke.com and include "Feature Request - Forum Thread #13029" in the subject line or use this form from the support page of our website.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 02-27-2018, 10:31 AM
Hang Hang is offline
Registered User
 
Join Date: Jul 2016
Posts: 20
Hi Brenda,

I didn't use the Log Session from the File menu. I was in Options>Session Option>Terminal>Log File and set the path there, once.

Quote:
There is not presently a default location for log files.
As you can see from my script I did not set a location. It just somehow saves all my log files to the same folder as my scripts are. I assume it knows because I set it once in the Log File in the Session Options menu?

Can you show me how to set log file location so it will save it there every time the script runs? Right now I am still doing it manually before I run my script if I want to save it to specific location using the Log File in the Session Options menu.

Here is a snippet of my code:

Code:
currentTab = crt.GetScriptTab()
filename = crt.Dialog.Prompt("Enter filename")
currentTab.Session.Log(False)

def test1:
  Test1 = currentTab.Session.LogFileName = filename + "Test1.log"		
  currentTab.Screen.Synchronous = True
  currentTab.Session.Log(True)
  ...
  CODE
  ...
  currentTab.Session.Log(False)

def test2:
  Test2 = currentTab.Session.LogFileName = filename + "Test2.log"		
  currentTab.Screen.Synchronous = True
  currentTab.Session.Log(True)
  ...
  CODE
  ...
  currentTab.Session.Log(False)

def test3:
 ...
 CODE 
 ...

def test4:
 ...
 CODE
 ...

test1()
test2()
test3()
test4()
Reply With Quote
  #6  
Old 02-27-2018, 01:03 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,937
Hi Hang,

Default Session is what is used if you are not connecting with a saved session.

So it sounds like there is where you would want to set the common log folder options.
__________________
Thanks,
--Brenda

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

Tags
log


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 09:41 PM.