Configure a logging task
The logging task needs run on the same image as the coordination queue manager. We can log to Db2®.
Creating a logging task
Copy the PDSE to make the logger specific PDSE. For example, user.MFT.LOGGER.
If you need to use a different credentials file, create one. For more information, see Creating an MFT credentials file.
Review member BFGCUSTM. Note that much of the content remains the same from the previous customization.
However, you need to:
- Change //SYSEXEC DD DSN=SCEN.FTE.JCL....
- Change LIBRARY to match the agent PDSE
- Change QMGR to the name of the coordination queue manager
- Make SERVICE_TYPE=LOGGER
- Change NAME to be the name of the logger (matching the PDSE)
- Review JOBCARD and change the jobname so that the name is different from the job names of the agents.
- Review BFG_JVM_PROPERTIES="-Xmx1024M"
If you are using the Db2 logger it is useful to create a file, so that we can capture Db2 traces to help identify Db2 problems.
The name of the file is specified in the JVM properties, where the JDBC trace properties file has content such asdb2.jcc.traceDirectory=/u/johndoe/fte db2.jcc.traceFile=jccTrace1 db2.jcc.traceFileAppend=false # turn on all traces # db2.jcc.traceLevel=-1 # turn off all traces db2.jcc.traceLevel=0Set two JVM propertiesBFG_JVM_PROPERTIES=-Ddb2.jcc.propertiesFile=/u/.../sql.properties -Ddb2.jcc.ssid=DBCAWhere /u/.../sql.properties is the name of your Db2 trace properties file, and DBCA is the name of your Db2 subsystem.
Submit this job, noting that the job requires exclusive access to the data set. The jobs for the agent all have names like BFGLG*.
Logging to files
For more information on logging to Db2, see Creating a logging task, when logging to Db2
Rename member BFGLGCRS. This job updates files in the Managed File Transfer (MFT) directory and uses CSQUTIL to create agent specific queues in the local queue manager.
The original file has command %BFGCMD CMD=fteCreateLogger -h which lists the syntax of the command.
To create the logger task comment out the %BFGCMD CMD=fteCreateLogger -h by putting /* in front of the statement, making sure that column one is blank.
Remove the comments from the second command and configure the statements. For example:%BFGCMD CMD=fteCreateLogger + -p MQPH + -loggerQMgr MQPH + -loggerType FILE + -fileLoggerMode circular + -fileSize 5MB + -fileCount 5 + -p MQPH + -credentialsFile //'<MFTCredentialsDataSet(MemberName)>' LOGGERCheck the output to see that it has processed successfully. Tip: Copy the pathname of the logger.properties file from the output of the job to a member in the PDSE of the agent. For example copy into member APATH/u/user_ID/fte/wmqmft/mqft/config/MQPH/loggers/LOGGER/logger.propertiesThis is useful if you need to display properties file.
Add the directory to this file:/u/user_ID/fte/wmqmft/mqft/logs/MQPH/loggers/LOGGER/If you are logging to file, the log files are stored in this directory, for example LOGGER0-20140522123654897.log.
Trace files are in the log subdirectory, for example/u/user_ID/fte/wmqmft/mqft/logs/MQPH/loggers/LOGGER/logsWe can now start the logging task.
Creating a logging task, when logging to Db2
Rename member BFGLGCRS.
This job updates files in the MFT directory and uses CSQUTIL to create agent specific queues in the local queue manager.
You need to know:
Table 1. Db2 variables Db2 name Example -dbName databaseName We can get this from the location value in message DSNL004I for your Db2 subsystem - dbDriver filePath For example /db2/db2v10/jdbc/classes/db2jcc.jar -dbLib filePath For example /db2/db2v10/jdbc/lib/libdb2jcct2zos_64.so Edit the file. The original file has command %BFGCMD CMD=fteCreateLogger -h which lists the syntax of the command.
Remove the comments from the second command and configure the statements. For example%BFGCMD CMD=fteCreateLogger + -p MQPH + -loggerQMgr MQPH + -loggerType DATABASE + -dbType DB2 + -dbName DSNDBCP + -dbDriver /db2/db2v10/jdbc/classes/db2jcc.jar + -dbLib /db2/db2v10/jdbc/lib/ + -credentialsFile //'<MFTCredentialsDataSet(MemberName)>' + LOGGERTo create the logger task comment out the %BFGCMD CMD=fteCreateLogger -h by putting /* in front of the statement, making sure that column one is blank.
Submit the job and check the output to see that it has processed successfully. Tip: Copy the pathname of the logger.properties file from the output of the job to a member in the PDSE of the agents. For example copy into member APATH:/u/user_ID/fte/wmqmft/mqft/config/MQPH/loggers/LOGGER/logger.properties into member USSThis is useful if you need to display the properties file
Trace files are in the log subdirectory, for example:/u/user_ID/fte/wmqmft/mqft/logs/MQPH/loggers/LOGGER/logs
Creating Db2 tables
You need to create the Db2 tables. The definitions are in the USS file mqft/sql/ftelog_tables_zos.sql.
Create a member Db2 in your PDSE. Edit this member and use the COPY command on the command line. Copy from the USS definitions file.
Because site-specific requirements can vary greatly, this file only specifies the basic structures of the tables, and a tablespace where they will be located.
The tablespace is specified, by the SQL script, to ensure that it is created using a buffer pool with a page size sufficient to hold the largest tables rows possible. Note that attributes such as LOB locations, and so on, are not specified.
Your database administrator might want to modify a copy of this file, to define these performance-related attributes.
This file also assumes a default schema name of FTELOG, default tablespace name of FTELOGTS, and database name of FTELOGDB. We can change these names if you need, to match an existing database and any local naming conventions, by following the process described in the comments at the beginning of the file.
Important: Use online facilities like SPUFI to run the commands, because there are comments in the file, and batch programs like DSNTINAD do not accept comments.
Starting the logger task
Rename, review and submit the member BFGLGST You should get the message BFGDB0023I: The logger has completed startup activities and is now running.
Logger operations
To display the logger status, Rename, review, and submit member BFGLGSH
To stop the logger, Rename, review, and submit member BFGLGSP.