how to get WinSCP to log in XML format?

Advertisement

Walden
Guest

how to get WinSCP to log in XML format?

Hello all,

I've been spent half an hour - an hour of my life to find the answer to this question without any result, neither google, this site, or this forum gave me anything. The only result I got is that I feel really dumb, that I have to ask for this.

Maybe some words in the documentation, an example commandline wont hurt. All there is in the XML part is about the format. Nothing on how to initiate it.

Thanks for your attention.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: how to get WinSCP to log in XML format?

Please read documentation. If that does not help, come back.

Make sure you use the latest version of WinSCP.
_________________
Martin Prikryl

Reply with quote

Walden
Guest

Hi,

The documentation does not help indeed. Maybe you can show the part where it tells HOW to log in XML ? :)

I only found out how to do it, because I was sure there's some kind of hint atleast on the page linked.

I have read the docs very carefully, but there's not a single line explaining that XML scripting has to be activated in the setup in the GUI. There's not a single line in the whole docs on how to activate XML logging.

It's pretty frustrating, as I needed this for scripting and I expected it can be invoked from the commandline, so I did not think for a milisecond that I should use the GUI, or look around in the GUI for such a setting. Naturally one would expect this is only doable from the commndline.


I think you should add something like "XML logging can be activated trough the settings/logging tab etc ". Both to the page you linked, and to the XML page.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

You can activate it from command-line, see documentation. The page I've posted before links to both ways of activating the logging (GUI and command-line). That's why I've posted it.

Reply with quote

Walden
Guest

Well, maybe the problem is with me, but I could not find this myself, I'd suggest adding some links to the page explaining XML logging, because I have searched it there. thanks for your help!

Reply with quote

Guest

In the documentation link it states that you can enable XML logging by adding .xml as the extension of the file you are logging with. Example /log=C:\MyLogFile.xml

Reply with quote

Marty
Guest

XML logging

When I try:
winscp.com /script-my.scr /xmllog=F:\mydir\log.xml
I do not get a log file.

How do you get an XML log???

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: XML logging

Marty wrote:

When I try:
winscp.com /script-my.scr /xmllog=F:\mydir\log.xml
I do not get a log file.

How do you get an XML log???
Make sure you are using the latest version of WinSCP.

Reply with quote

Mutos
Guest

Use /log and NOT /xmllog in WinSCP 4.3.3

Hi all,


Thanks for the information !

After reading and re-reading the documentation and the whole topic from the beginning to the end, and tested many ways to get a XML log, from direct command window, VBS, JS and PS, I finally found a working answer.

I finally succeeded with the /log and NOT the /xmllog parameter. In the documentation, it is said that it is deprecated and just maintains compatibility with older version.

As I did get the WinSCP from colleagues, I thought it to be the latest version. But when I checked, I found it to be 4.3.3 and on the site, the latest is 5.5.3. So I suppose the xmllog parameter was introduced after 4.3.3. Now I've downloaded 5.5.3 and as I can only check on a physicaly remote machine, I'll test it and keep you informed...

Reply with quote

Mutos
Guest

4.3.3 to 5.5.3 : /xmllog works now

Hi all,


Just a reply to signal the script now works as expected with /xmllog instead of /log in 5.5.3 ! Indeed I confirm your saying, prikryl : before trying anything else, make sure you use the latest version of WinSCP !!!!

Reply with quote

Chau
Guest

Create xml log file using winscpnet assembly

Hi all,
Firstly, I'm sorry about my bad English.
I'm using winscpnet.dll for my project and when I want to view the xml log of winscp, I got this code:
session.XmlLogPath = @"C:\MyProject\MyLog.xml";
The result is nothing, pls help me for that.
I put that code before session.Open, and the version of winscp I'm using is 5.5.6

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: Create xml log file using winscpnet assembly

Chau wrote:

Hi all,
Firstly, I'm sorry about my bad English.
I'm using winscpnet.dll for my project and when I want to view the xml log of winscp, I got this code:
session.XmlLogPath = @"C:\MyProject\MyLog.xml";
The result is nothing, pls help me for that.
I put that code before session.Open, and the version of winscp I'm using is 5.5.6
The .NET assembly uses the XML log internally and deletes it when Session.Dispose is called.

Reply with quote

Chau
Guest

Re: Create xml log file using winscpnet assembly

martin wrote:

Chau wrote:

Hi all,
Firstly, I'm sorry about my bad English.
I'm using winscpnet.dll for my project and when I want to view the xml log of winscp, I got this code:
session.XmlLogPath = @"C:\MyProject\MyLog.xml";
The result is nothing, pls help me for that.
I put that code before session.Open, and the version of winscp I'm using is 5.5.6
The .NET assembly uses the XML log internally and deletes it when Session.Dispose is called.
Hi prikryl,
Thanks for your help!
I wonder how can I catch a xml logs file to trace status of my files after I do upload/download method?
Can you help me that? I'm coding assembly with C#.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: Create xml log file using winscpnet assembly

Chau wrote:

I wonder how can I catch a xml logs file to trace status of my files after I do upload/download method?
Can you help me that? I'm coding assembly with C#.
You generally do not need that.
Use information provided by TransferOperationResult returned by Session.PutFiles or Session.GetFiles:
https://winscp.net/eng/docs/library_transferoperationresult
Or subscribe Session.FileTransferred:
https://winscp.net/eng/docs/library_session_filetransferred
_________________
Martin Prikryl

Reply with quote

deepthireddy
Guest

Missing filename in failure node

Hi,
I really need help on this.

I could able to log xml from FTPS operation, I could see "FileName" for all successful transfers but cannot see fileinfo for failed ones.
<failure> node is showing as below, I do not understand why cant I track file names. Please help how to add filename for failed ones.

<failure>
<message>Error listing directory '/SPD2/Input'.</message>
<message>Could not retrieve directory listing</message>
<message>The system cannot find the path specified. </message>
</failure>

Myscript
open ftps://xx:aa@yyyyy -explicitssl -rawsettings
synchronize remote c:\FTPRoot\SPD\WS\WS_A01 /SPD1/Input
synchronize remote c:\FTPRoot\SPD\WS\WS_A04 /SPD2/Input
synchronize remote c:\FTPRoot\SPD\WS\WS_A06 /SPD3/Input

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: Missing filename in failure node

deepthireddy wrote:

Hi,
I really need help on this.

I could able to log xml from FTPS operation, I could see "FileName" for all successful transfers but cannot see fileinfo for failed ones.
<failure> node is showing as below, I do not understand why cant I track file names. Please help how to add filename for failed ones.

<failure>
<message>Error listing directory '/SPD2/Input'.</message>
<message>Could not retrieve directory listing</message>
<message>The system cannot find the path specified. </message>
</failure>

Myscript
open ftps://xx:aa@yyyyy -explicitssl -rawsettings
synchronize remote c:\FTPRoot\SPD\WS\WS_A01 /SPD1/Input
synchronize remote c:\FTPRoot\SPD\WS\WS_A04 /SPD2/Input
synchronize remote c:\FTPRoot\SPD\WS\WS_A06 /SPD3/Input
Because there's no specific file associated with this error. The synchronization did not even start, because the target directory does not exist.

Reply with quote

deepthireddyb
Guest

Re: Missing filename in failure node

martin wrote:


Because there's no specific file associated with this error. The synchronization did not even start, because the target directory does not exist.

Ok, got you. Thanks!!

Reply with quote

Advertisement

You can post new topics in this forum