As Charles explained, you cannot change the STAF Data Directory
dynamically.  The STAF DataDir can only be set via the STAF.cfg file
(period).

However, you can specify a directory of your choosing when you register the
LOG service via its DIRECTORY parameter.  Since you can register/unregister
STAF services dynamically via the SERVICE service's ADD/REMOVE requests,
then you could dynamically register the LOG service, specifying the
directory you want the LOG service to use.  See the STAF User's Guide for
more information on the LOG service and it's DIRECTORY parameter.

Note that the STAF service loader service  will automatically register the
LOG service (with default settings) if a request is submitted to the LOG
service and the LOG service is not yet registered (if the following line is
in the STAF.cfg file: serviceloader library STAFDSLS).  This means that If
another service, e.g. MONITOR, STAX, is registered via the STAF.cfg file,
then the LOG service may have already been registered with it's default
settings (if the service submitted a request to the LOG service).  If this
case, you would need to first submit a REMOVE request to the SERVICE
service to unregister the LOG service and then submit a ADD request to the
SERVICE service to register the LOG service specifying the DIRECTORY
parameter value of your choice.  For example:

C:\>STAF local SERVICE REMOVE SERVICE LOG
Response
--------

C:\>STAF local SERVICE ADD SERVICE LOG LIBRARY STAFLog PARMS "DIRECTORY
C:/tests/logs"
Response
--------

C:\>staf local SERVICE QUERY SERVICE LOG
Response
--------
{
  Name      : LOG
  Library   : STAFLog
  Executable: <None>
  Options   : []
  Parameters: DIRECTORY C:/tests/logs
}

You may want to look at using the LIFECYCLE service to unregister/register
the LOG service whenever STAF starts up.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 838-8347 or Tieline 678-8347



                                                                           
             "Gurpreet Anand"                                              
             <[EMAIL PROTECTED]                                             
             ersistent.co.in>                                           To 
             Sent by:                  Charles Rankin/Austin/[EMAIL PROTECTED]  
   
             staf-users-bounce                                          cc 
             [EMAIL PROTECTED]         [email protected],   
             ge.net                    "'Rahul Wagh'"                      
                                       <[EMAIL PROTECTED]>       
                                                                   Subject 
             02/18/2008 02:41          Re: [staf-users] How to change      
             AM                        value of STAD/Datadir from STAX     
                                       job?                                
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hello,

We are developing a test automation framework in .Net which internally uses
STAF (customized as per our requirements). We are also using the STAF
logging for framework logging. Now we want to log the messages in the
Framework directory and not in STAF MACHINE log directory. For doing this
we wanted to set the variable for log directory (though this can be done
with STAF.cfg- explained later why we don’t want this way), but this is
currently not happening. We don’t want to do this in the STAF.cfg file, as
if one wants to move the framework from one location to another, then he
has to remember and change the STAF.cfg file for the LOG directory location
in the STAF.cfg file( and if he/she forgets then the log messages will be
logged somewhere else – which is not what we expected). It looks a little
more buggy and less maintainable. Depending on these LOGS our framework
will generate some report. So, for this the log directory should be known
to the framework and we decided to log in the framework directory itself.
This is why we want to set the log directory programmatically and not using
STAF.cfg file.

Let us know how we can proceed with this. Also let us know if there is any
other cleaner way via which we can do this at runtime ( and not using the
STAF.cfg static way)? Get back to us if the above is still not clear.

-Gurpreet

From: Charles Rankin [mailto:[EMAIL PROTECTED]
Sent: Friday, February 15, 2008 9:31 PM
To: Gurpreet Anand
Cc: 'Rahul Wagh'; [email protected]
Subject: Re: [staf-users] How to change value of STAD/Datadir from STAX
job?


[EMAIL PROTECTED] wrote on 02/15/2008 09:24:52 AM:

> We would like to do it dynamically , and not using the STAF.cfg
> file. Any ideas?

It's not really practical to allow the STAF Data Directory to change
dynamically.  There's the potential that specific items could be allowed to
change dynamically, such as the logging directory.  It would be good to
know what things you feel you need dynamic control over, and why.  Some
things may already be possibly, some things may have alternative solutions,
and others we might readily be able to implement.

Note, if you only really needed to change the STAF Data Directory once,
then you could conceivably alter the STAF.cfg file and restart STAFProc.
The process would be a little cumbersome, but is doable.

--
Charles Rankin


DISCLAIMER ========== This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Ltd. It is intended
only for the use of the individual or entity to which it is addressed. If
you are not the intended recipient, you are not authorized to read, retain,
copy, print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies of
this message. Persistent Systems Ltd. does not accept any liability for
virus infected mails.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to