Examples of using log statements
Suppose you insert DEBUG log statements without actions in a monitor. You specify ERROR as the log level for that monitor. The correlator ignores log statement output of log statements with identifiers of INFO or DEBUG. But then there are some problems. You use the engine_management correlator utility to change the log level to DEBUG. Now the correlator sends output from all log statements to the appropriate log file.
Following is another example:
log "Log statement number " + logNo() at DEBUG;
action logNo() {
logNumber := logNumber + 1;
return logNumber.toString();
}
In this example, the correlator always executes the log statement because it calls an action. However, the log level in effect must be DEBUG for the correlator to send the string to the log file. If the log level is anything else, the correlator discards the string because the log level in effect is lower than the log level in the log statement.