python - Dumping log messages to console when executing a STAX file -
i have xml file (stax) execute command line
[root@local ~]# staf local stax execute file "/root/test2.xml" args "{'command':'ls'}" wait returnresult and following output ..
response -------- { job id : 57 start date-time: 20130405-18:27:13 end date-time : 20130405-18:27:13 status : normal result : 0 job log errors : [] testcase totals: { tests : 0 passes: 0 fails : 0 } } script contents ..
<?xml version="1.0" encoding="utf-8" standalone="no"?> <!doctype stax system "stax.dtd"> <stax> <defaultcall function="runcommand"/> <function name="runcommand"> <function-list-args> <function-required-arg name="command"/> </function-list-args> <try> <sequence> <script>print("this");</script> <message>'%s %s: a: %s' % (staxcurrenttestcase, staxcurrentfunction, command)</message> <log>'test'</log> <return>0</return> </sequence> <catch exception="'eterminatefunction'" var="einfo"> <sequence> <log level="'fail'">'%s %s: terminating function error: %s' % (staxcurrenttestcase, staxcurrentfunction, einfo)</log> <tcstatus result="'fail'">einfo</tcstatus> <return>1</return> </sequence> </catch> </try> </function> </stax> how come none of logging dumped console during or after execution?
<log>, <message> or python <script>print("this")</script>
as know
the stax execute wait returnresult request returns in result supposed return documented in section "execute", sub-section "results", in stax user's guide at. returns more summary type information job , errors logged in stax job log.
the element in stax job logs message in stax job user log documented in section "log: log message in stax job user log" in stax user's guide @ . section says @ "stax logging" section, sub-section "querying stax job user logs" @ more information on how query stax job user log view messages you've logged in stax job.
or, query stax job user log stax job job id 1 on stax service machine, specify:
staf local log query machine {staf/config/machinenickname} logname stax_job_1_user note: when run stax job, stax job log created. different stax job user log. stax job user log created if stax job logged data in (e.g. via element).
the element in stax job sends message stax monitor documented in section "message: send message stax monitor" in stax user's guide @ http://staf.sourceforge.net/current/stax/staxug.html#header_message_element. see messages sent stax monitor, need run job via stax monitor. messages displayed in "messages" panel when running stax job.
as output "print" statement within element goes, controlled pythonoutput parameter can specified when registering stax service or changed via stax set pythonoutput request, or overridden particular stax job when executing stax job (by specifying pythonoutput option on stax execute request or via stax monitor). talked in section "installation , configuration". sub-section "stax service machine" at , section "execute" in stax user's guide.
the default log python print output in stax job user log. so, if you're using default setting, "print" output logged stax job user log (same place message in element logged) , can view querying stax job user log talked above.
- pythonoutput specifies python stdout/stderr should redirected (e.g. if use print statement in element in stax job). valid values following (not case-sensitive):
- "jobuserlog" indicates log python output in stax job user log. default.
- "message" indicates send python output stax monitor , display in messages panel.
- "jobuserlogandmsg" indicates log python output in stax job user log , send stax monitor , display in messages panel.
- "jvmlog" indicates write python output in jvm log stax service using following format know stax job originated output , @ time: <
timestamp> [jobid: <jobid>] <python output>
Comments
Post a Comment