Configuring a logging task
The logging task needs run on the same image as the coordination queue manager. You 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. See Configuring MQMFTCredentials.xml on z/OS®.
Review member BFGCUSTM. Note that much of the content remains the same from the previous customization.
- 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 you can capture Db2 traces to help identify Db2 problems.
db2.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=0
BFG_JVM_PROPERTIES=-Ddb2.jcc.propertiesFile=/u/.../sql.properties
-Ddb2.jcc.ssid=DBCA
Where /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.
%BFGCMD CMD=fteCreateLogger +
-p MQPH +
-loggerQMgr MQPH +
-loggerType FILE +
-fileLoggerMode circular +
-fileSize 5MB +
-fileCount 5 +
-p MQPH +
-credentialsFile //'<MFTCredentialsDataSet(MemberName)>'
LOGGER
logger.properties file from the output of the job to a member in the PDSE of
the agent. APATH
/u/user_ID/fte/wmqmft/mqft/config/MQPH/loggers/LOGGER/logger.properties
This is useful if you need to display properties 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.
/u/user_ID/fte/wmqmft/mqft/logs/MQPH/loggers/LOGGER/logs
You 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.
| Db2 name | Example |
|---|---|
| -dbName databaseName | You 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.
%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)>' +
LOGGER
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.
logger.properties file from the output of the job to a
member in the PDSE of the agents. APATH:
/u/user_ID/fte/wmqmft/mqft/config/MQPH/loggers/LOGGER/logger.properties into member USS
This is useful if you need to display the properties file
/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 z/OS UNIX System Services 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 z/OS UNIX System Services definitions file.
Because site-specific requirements can vary greatly, this file only specifies the basic structures of the tables, and a table space where they will be located.
The table space 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. You 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.
See Executing SQL by using SPUFI for more information. In addition, CSQ45STB in SCSQPROC has sample JCL that you can customize to do the Db2 SELECT commands.
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.