From: Joseph J V. <Joe...@us...> - 2005-05-27 13:07:20
|
I am using STAX to drive my testing, and I have the requirement to write log data during my test run, and to save the log files in a persistent manner to document my testing results. I have been using the STAX <log> and <message> elements to log information to the user job log, but then I read the fine print and realized the following: Observation #1: You don't get an opportunity to specify the name of the STAX job logs (either the job log or the job user log) -- they're named STAX_Job_nn.log and STAX_Job_nn_User.log, respectively, and they're placed in the default directory for STAF logs. Observation #2: The default-named logs are not persistent, because the job ID number resets upon each restart of the STAX service. You can specify that if a job with the same number as a previous job runs, that it will either clear the previous logs (for that job number) or append to them, but for my purposes neither of those options is particularly useful. Observation #3: The STAF 'LOG' service has a "LOGNAME" operand which can be used to specify a different log file name. However, the STAX <log> and <message> elements don't appear to have any way to specify that name. Am I correct in my discoveries? If so, then taken as a whole this means I cannot code my STAX job to write to a log file that will automatically persist inviolate until I clear it. I can think of several options: 1. Write a wrapper around STAX, to invoke it via the command-line and then use file-copy utilities or the STAF LOG service to retrieve the log data and copy it to a persistent location. 2. Don't use the STAX <log> and <message> elements; instead, use a <stafcmd> element or use a <call> element to call the "STAF" utility function... either way, cal the STAF LOG service specifying the LOGNAME operand so that I can give my logfile the name I want it to have. (presumably I would derive a unique job-name for each testjob run, maybe including the date and time so that subsequent runs of the same job would not overwrite the previous log). 3. Include code at the very end of my STAX job to copy the log files for this run from the default STAF data directory into my persistent directory. Option #1 would work fine except that it means I can't drive my testing from the STAX Monitor. Option #2 would probably work but it's going to make my code much bulkier and therefore harder to read and maintain. Option #3 would probably work but I'm wondering if I'll mess things up by copying the log for a job that's still running before it's actually terminated. At a minimum I'd probably be missing some concluding data from the job log, wouldn't I? Does anyone have advice as to which of these options would be best, or do you know of other options? ---------------------------------------------------------------------------------------- Joe Veilleux IBM/Rational CTG Quality Engineering 20 Maguire Road Lexington MA 02421 Tel: (781) 676-2491 Fax: (781) 676-2600 Email: Joe...@us... |