Differences

This shows you the differences between the selected revisions of the page.

2011-11-03 2012-01-04
in beta xml log can be used for detecting batch result (martin) grouping (martin)
Line 93: Line 93:
  * The particular operation that failed does not have corresponding log element.   * The particular operation that failed does not have corresponding log element.
-==== Results/Errors of Script in the Beta Release ==== +==== [[result_script]] Results/Errors of Script in the Beta Release ==== 
-When the script fails (WinSCP [[scripting#using_scripting|exit code]] is 1), the top level ''session'' element will include one or more ''failure'' elements, each containing one or more ''message'' elements with error message(s).+When the script fails (WinSCP [[scripting#using_scripting|exit code]] is 1), the top level ''session'' element or ''group'' element (when [[logging_xml#group|grouping]] is enabled) will include one or more ''failure'' elements, each containing one or more ''message'' elements with error message(s).
-If the particular error was associated with a physical operation, the error message will be included both in ''result'' child element of the respective operation element and in ''failure'' child element of top level ''session'' element.+If the particular error was associated with a physical operation, the error message will be included both in ''result'' child element of the respective operation element and in ''failure'' child element of top level ''session'' element or ''group'' element.
<code xml> <code xml>
Line 118: Line 118:
</code> </code>
-===== Elements =====+===== [[group]] Grouping Operations for Commands ===== 
 +&future_feature 
 + 
 +When using XML logging together with [[scripting|scripting]], [[logging_xml#elements|operations]] and [[logging_xml#result_script|failures]] belonging to the same command can be groupped using parent ''group'' element: 
 + 
 +<code xml> 
 +<group name="put -preservetime d:\*.txt" start="2012-01-04T14:25:10.204Z"> 
 +  <upload> 
 +    <filename value="d:\readme.txt" /> 
 +    <destination value="/home/user/readme.txt" /> 
 +    <result success="true" /> 
 +  </upload> 
 +  <upload> 
 +    <filename value="d:\examplefile.txt" /> 
 +    <result success="false"> 
 +      <message>Cannot create remote file '/home/user/examplefile.txt'.</message> 
 +      <message>Permission denied. 
 +Error code: 3 
 +Error message from server: Permission denied 
 +Request code: 3</message> 
 +    </result> 
 +  </upload> 
 +  <failure> 
 +    <message>Cannot create remote file '/home/user/examplefile.txt'.</message> 
 +    <message>Permission denied. 
 +Error code: 3 
 +Error message from server: Permission denied 
 +Request code: 3</message> 
 +  </failure> 
 +</group> 
 +</code> 
 + 
 +Grouping can be enabled on [[commandline#scripting|command-line]]. 
 + 
 +//Grouping is particularly useful, when you are [[guide_interpreting_xml_log#continuous|continuously reading of the XML log file]]. By receiving ''</group>'' you know that command execution has finished.// 
 + 
 +===== [[elements]] Elements =====
All operation elements below have ''[[logging_xml#result|result]]'' child element in addition to listed child elements. All operation elements below have ''[[logging_xml#result|result]]'' child element in addition to listed child elements.
Line 341: Line 377:
===== Example ===== ===== Example =====
-//Note that the ''failure'' element will be included only with the latest beta release.// &beta+//Note that the ''failure'' element will be included only with the latest beta release and ''group'' elements will be included only with the next release and, if enabled only.// &beta &future
<code xml> <code xml>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" <session xmlns="http://winscp.net/schema/session/1.0"
        name="martin@example.com" start="2009-03-02T19:34:57.734Z">         name="martin@example.com" start="2009-03-02T19:34:57.734Z">
-  <upload+  <group name="put -preservetime -permissions=644 d:\www\about.htm" start="2012-01-04T14:28:45.393Z"
-    <filename value="d:\www\about.htm" /> +    <upload> 
- ···<destination value="/home/martin/public_html/about.html" /> +······<filename value="d:\www\about.htm" /> 
- ···<result success="true" /> + ·····<destination value="/home/martin/public_html/about.html" /> 
- ·</upload> + ·····<result success="true" /> 
- ·<touch> + ···</upload> 
- ···<filename value="/home/martin/public_html/about.html" /> + ···<touch> 
- ···<modification value="2008-12-28T11:22:19.000Z" /> + ·····<filename value="/home/martin/public_html/about.html" /> 
- ···<result success="true" /> + ·····<modification value="2008-12-28T11:22:19.000Z" /> 
- ·</touch> + ·····<result success="true" /> 
- ·<chmod> + ···</touch> 
- ···<filename value="/home/martin/public_html/about.html" /> + ···<chmod> 
- ···<permissions value="rw-r--r--" /> + ·····<filename value="/home/martin/public_html/about.html" /> 
- ···<result success="true" /> + ·····<permissions value="rw-r--r--" /> 
- ·</chmod> + ·····<result success="true" /> 
-  <rm> + ···</chmod> 
-    <filename value="/home/martin/public_html/about.bak" /> +  <;/group> 
- ···<result success="false"> +  <group name=";rm about.bak" start="2012-01-04T14:28:47.892Z"
- ·····<message>No such file or directory.+    <rm> 
 +······<filename value="/home/martin/public_html/about.bak" /> 
 + ·····<result success="false"> 
 + ·······<message>No such file or directory.
Error code: 2 Error code: 2
Error message from server: No such file Error message from server: No such file
Request code: 13</message> Request code: 13</message>
-····</result> +······</result> 
- ·</rm> + ···</rm> 
- ·<failure> + ···<failure> 
- ···<message>No such file or directory.+ ·····<message>No such file or directory.
Error code: 2 Error code: 2
Error message from server: No such file Error message from server: No such file
Request code: 13</message> Request code: 13</message>
-··</failure>+····</failure
 +  </group>
</session> </session>
</code> </code>

Last modified: by martin