No.  What kind of custom information is it that you want to add to <log>?

Note that the <log> element is to log information to the STAX Job User 
log.  So, there is no other information that the STAF log service supports 
except for the message and the level.

If you want to log to another STAF log (with a name of your own choice), 
then you can do that by using a <stafcmd> to submit a LOG request to the 
STAF Log service and specfiy whatever LOGNAME you want.   Here's the help 
syntax for a LOG service's LOG request:

C:\>STAF local Log HELP
Response
--------
*** LOG Service Help ***

LOG    <GLOBAL | MACHINE | HANDLE> LOGNAME <Logname> LEVEL <Level>
       MESSAGE <Message> [RESOLVEMESSAGE | NORESOLVEMESSAGE]
...

See the STAF Users's Guide for more information about the STAF Log 
service. You would probably want to make these logs GLOBAL or MACHINE 
logs, and you could even store them on a central machine other than the 
'local' STAX machine.

Here's a snippet of STAX code that writes to a logname of your choice. You 
probably would want to put this code into a STAX function (e.g. <function 
name="LogToSTAFLog">) so that you could call this function, passing it the 
logname, message, and level, making it easy to use.

<script>
  logName = 'MyLog'
  message = 'Hi there'
  level = 'Info'
  request = 'LOG MACHINE LOGNAME %s LEVEL %s MESSAGE %s' % (logName, 
level, STAFUtil.wrapData(message))
</script>

<stafcmd>
  <location>'local'</location>
  <service>'LOG'</service>
  <request>request</request>
</stafcmd>

<if expr="RC != 0">
  <log level="'Error'" message="1">'STAF local LOG %s failed with RC=%s 
STAFResult=%s' % (requset, RC, STAFResult)
</if>

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Lu Yu <l...@vmware.com> 
03/30/2010 12:19 PM

To
"staf-users@lists.sourceforge.net" <staf-users@lists.sourceforge.net>
cc

Subject
[staf-users] Override log function in STAX






Hi
I am wondering if there is any way to override <log> in STAX. I want to 
add some custom information in <log>
 
 
Thanks a lot!
 
Lu
 
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to