Focal Point
[SHARING] In Agent Logging (was 'Writing to stdout.txt')

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3387056526

October 30, 2012, 08:12 PM
ABT
[SHARING] In Agent Logging (was 'Writing to stdout.txt')
How can I write to stdout.txt? Its a standard file in the agent directory. Seems like I'd redirect output of a command to &1 or something. I am trying to set up some on the fly logging to gauge % complete or at least what step the program is on as it is executing.

Any other ideas or examples? Don't have a lot of time to engineer something right now.

- ABT

This message has been edited. Last edited by: ABT,


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
November 01, 2012, 10:32 AM
ABT
This routine will create a job log in the agent directory. This may be useful for diagnosing issues or seeing job execution status prior to a job completing.

In our case, we have several very log running jobs that we want to see how close they are to finishing or if perhaps they are hung up. Current ReportCaster will only log when the job completes and trying to guess at the status based on the hold file names and where they are in the execution order really sucks.

joblog.fex (deployed to Standards folder in App Path).
-* File joblog.FEX
-*=====================================================================*
-*          COPYRIGHT 2012, VIDANT HEALTH, INC.                        *
-*                       Decision Support                              *
-*=====================================================================*
-* PROGRAM:       JOBLOG
-* PROGRAMMER:    Blake Thompson
-* DATE WRITTEN:  NOVEMBER 2012
-* PURPOSE:       Creates an Event Log in the Agent directory to see status
-*                of running job.  Must set JOBLOGMSG and call from a program.
-* INPUT:         None
-* PARAMETERS:    &JOBLOGMSG = Your logging text.
-* OUTPUT:        JOBRUN.LOG in agent directory
-* INCLUDES:      NONE
-*=====================================================================*
-*                    MODIFICATIONS                                    *
-*---------------------------------------------------------------------*
-* MM/DD/YYYY BY: ANALYST NAME
-*            DESCRIPTION OF MODIFICATION
-*=====================================================================*

-SET &JOBLOGDATE = &YYMD;
-SET &JOBLOGTIME = &TOD;

-SET &LOGFILENAME = "JOBRUN.LOG";

-DEFAULTH &JOBLOGMSG = 'No message text provided.';

-*  i.e.  [ 20121101 09.00.00 ] STEP 1 COMPLETE.
-DOS ECHO [ &JOBLOGDATE &JOBLOGTIME ] &JOBLOGMSG >> &LOGFILENAME
-RUN

-* Enable the below for testing.  This will allow the test job to exist for 2 minutes so you can verify logging.
-*-DOS ping 1.1.1.1 -n 1 -w 120000 > nul
-*-RUN


My_long_running_program.fex

... Long running step ...

-SET &JOBLOGMSG = 'Hit Setp 1';
-MRNOEDIT -INCLUDE JOBLOG
-RUN

... Long running step ...



I left it to the user to determine if they want to write out &LINES, &ERROR, or &RECORDS to the log.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro