Apama 10.3 | Apama Documentation | Deploying and Managing Apama Applications | Correlator Utilities Reference | Starting the correlator | Examples for specifying log filenames
Examples for specifying log filenames
This topic provides examples of specifying log filenames. The format for specifying a log filename is the same in the following cases:
*Starting the correlator and specifying a main correlator log file with the --logfile option.
*Starting the correlator and specifying a correlator input log file with the --inputLog option.
*Invoking engine_management --setLogFile to rotate the main correlator log.
*Invoking engine_management --setApplicationLogFile to create an EPL log file for a package, monitor or event.
The following specifies that the name of the main log is "correlator_status.log":
--logfile correlator_status.log
Suppose that the correlator processes events for a while, sends information to correlator_status.log, and then you find that you need to restart the correlator. If you restart the correlator and specify the exact same log filename, the correlator overwrites the first correlator_status.log file. To avoid overwriting a log, specify ${START_TIME} in the log file name specification when you start the correlator. For example:
--logfile correlator_status_${START_TIME}.log
The above command opens a log with a name something like the following:
This ensures that the correlator does not overwrite a log file. Now suppose that you want to be able to rotate the log, so you specify the ${START_TIME} and ${ID} tags:
The initial name of the log file is something like the one on the first line below. If you then rotate the log file then the correlator closes that file and opens a new file with a name like the one on the second line:
To specify an EPL log filename for messages generated in com.example.mypackge, you can specify the log filename as follows:
With that specification, messages generated in com.example.mypackage will go to a file with a name such as the one on the first line below. The time in the initial EPL log filename is the time that the initial log file is created. If you rotate the logs every 24 hours at midnight then the names of subsequent EPL log files will be something like the names in the second and third lines below.
If you want to run multiple correlators with the same arguments but with separate log files, you can use the process ID to differentiate them:
--logfile correlator_${PID}.log
The above command will produce a log file with a name such as the following, where each correlator will have a unique log file:
UNIX note
In most UNIX shells, when you start a correlator you most likely need to escape the tag symbols, like this:
correlator -l license --inputLog input_\${START_TIME}_\${ID}.log

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.