Topic "Log File not being created"

Author Message
bah614

Guest


I'm not sure what I am doing wrong. I have a power script that uses the below code. It won't create the log file. The folder exists, and I have full rights to it. I can created and delete files there just fine. I am using 5.7.6

# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"

# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = "65.82.131.58"
$sessionOptions.UserName = "*****"
$sessionOptions.Password = "*****"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "C:\WinSCPLogs\test.xml"

try
{
# Connect
$session.Open($sessionOptions)
Advertisements
bah614

Guest


FYI I just tried 5.7.7 still no luck (as well as the new 5.7.7 .NET dll). I know the code is executing, because at the end I do a send-mail and that comes through.
bah614

Guest


Still not sure why it is not logging, but I figured out the issue that I needed the log. Remote folder path is case sensitive. I'd like to get the logging working, but it can be prioritized lower.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
WinSCP get confused by the .xml extension. You have to use another one. The session log is not XML, it's a plain text file. Use for example "C:\WinSCPLogs\test.log".
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License