Change log file extension to .xml does capture the ls output. Thanks a lot.
XML log content is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="https://winscp.net/schema/session/1.0" name="ftpUser@localhost" start="2010-06-07T14:27:08.965Z">
<upload>
<filename value="aaa.txt" />
<destination value="/TargetFolder/aaa.txt" />
<result success="true" />
</upload>
<ls>
<destination value="/TargetFolder" />
<files>
<file>
<filename value=".." />
<type value="D" />
<modification value="1899-12-30T04:00:00.000Z" />
<permissions value="---------" />
</file>
<file>
<filename value="aaa.txt" />
<type value="-" />
<size value="76853774" />
<modification value="2010-06-07T14:27:00.000Z" />
<permissions value="---------" />
</file>
</files>
<result success="true" />
</ls>
</session>
Original log file's extension is .log. Content is as follow, the execution trace without ls output:
. 2010-06-04 17:03:28.121 --------------------------------------------------------------------------
. 2010-06-04 17:03:28.121 WinSCP Version 4.2.6 (Build 721) (OS 5.1.2600 Service Pack 3)
. 2010-06-04 17:03:28.121 Login time: Friday, June 04, 2010 5:03:28 PM
. 2010-06-04 17:03:28.121 --------------------------------------------------------------------------
. 2010-06-04 17:03:28.121 Session name: ftpUser@localhost
. 2010-06-04 17:03:28.121 Host name: localhost (Port: 21)
. 2010-06-04 17:03:28.121 User name: ftpUser (Password: Yes, Key file: No)
. 2010-06-04 17:03:28.121 Tunnel: No
. 2010-06-04 17:03:28.121 Transfer Protocol: FTP
. 2010-06-04 17:03:28.121 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2010-06-04 17:03:28.121 Proxy: none
. 2010-06-04 17:03:28.121 FTP: FTPS: None; Passive: No [Force IP: No]
. 2010-06-04 17:03:28.121 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-06-04 17:03:28.121 Cache directory changes: Yes, Permanent: Yes
. 2010-06-04 17:03:28.121 DST mode: 1
. 2010-06-04 17:03:28.121 --------------------------------------------------------------------------
. 2010-06-04 17:03:28.121 Connecting to localhost ...
. 2010-06-04 17:03:28.121 Connected with localhost. Waiting for welcome message...
< 2010-06-04 17:03:28.121 220 Microsoft FTP Service
> 2010-06-04 17:03:28.121 USER ftpUser
< 2010-06-04 17:03:28.121 331 Password required for ftpUser.
> 2010-06-04 17:03:28.121 PASS ****
< 2010-06-04 17:03:28.121 230-You have conencted to test site
< 2010-06-04 17:03:28.121 230 User ftpUser logged in.
> 2010-06-04 17:03:28.121 SYST
< 2010-06-04 17:03:28.121 215 Windows_NT
> 2010-06-04 17:03:28.121 FEAT
< 2010-06-04 17:03:28.121 500 'FEAT': command not understood
. 2010-06-04 17:03:28.121 Connected
. 2010-06-04 17:03:28.121 --------------------------------------------------------------------------
. 2010-06-04 17:03:28.121 Using FTP protocol.
. 2010-06-04 17:03:28.121 Doing startup conversation with host.
> 2010-06-04 17:03:28.121 PWD
< 2010-06-04 17:03:28.121 257 "/" is current directory.
. 2010-06-04 17:03:28.121 Getting current directory name.
. 2010-06-04 17:03:28.121 Startup conversation with host finished.
. 2010-06-04 17:03:28.121 Cached directory change via "/TargetFolder" to "/TargetFolder".
. 2010-06-04 17:03:28.121 Getting current directory name.
. 2010-06-04 17:03:28.121 Copying 1 files/directories to remote directory "/TargetFolder"
. 2010-06-04 17:03:28.121 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask:
. 2010-06-04 17:03:28.121 TM: M; ClAr: No; CPS: 0; ExclM(No):
. 2010-06-04 17:03:28.121 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2010-06-04 17:03:28.121 File: "aaa.txt"
. 2010-06-04 17:03:28.121 Copying "aaa.txt" to remote directory started.
. 2010-06-04 17:03:28.121 Ascii transfer mode selected.
. 2010-06-04 17:03:28.121 Starting upload of aaa.txt
> 2010-06-04 17:03:28.121 CWD /TargetFolder/
< 2010-06-04 17:03:28.121 250 CWD command successful.
> 2010-06-04 17:03:28.121 PWD
< 2010-06-04 17:03:28.121 257 "/TargetFolder" is current directory.
> 2010-06-04 17:03:28.121 TYPE A
< 2010-06-04 17:03:28.121 200 Type set to A.
> 2010-06-04 17:03:28.121 PORT 127,0,0,1,4,248
< 2010-06-04 17:03:28.121 200 PORT command successful.
> 2010-06-04 17:03:28.121 LIST
< 2010-06-04 17:03:28.121 150 Opening ASCII mode data connection for /bin/ls.
< 2010-06-04 17:03:28.136 226 Transfer complete.
> 2010-06-04 17:03:28.136 TYPE A
< 2010-06-04 17:03:28.136 200 Type set to A.
> 2010-06-04 17:03:28.136 PORT 127,0,0,1,4,249
< 2010-06-04 17:03:28.136 200 PORT command successful.
> 2010-06-04 17:03:28.136 STOR aaa.txt
< 2010-06-04 17:03:28.136 150 Opening ASCII mode data connection for aaa.txt.
< 2010-06-04 17:03:34.792 226 Transfer complete.
. 2010-06-04 17:03:34.792 Upload successful
. 2010-06-04 17:03:34.792 Disconnected from server
Once change extension from .log to .xml, the excusion traceis gone.
Question: how to log both execusion trace and the ls output?
Reply with quote