Developing Apama Applications > Developing Apama Applications in EPL > Defining What Happens When Matching Events Are Found > Logging and printing > Log levels determine results of log statements
Log levels determine results of log statements
The correlator supports the following log levels:
0
OFF
No entries go to log files.
1
CRIT
Least amount of entries go to log files.
2
FATAL
     |
3
ERROR
     |
4
WARN
     |
5
INFO
     |
6
DEBUG
           |
7
TRACE
Greatest amount of entries go to log files.
You use log levels to filter out log strings. If the log level in effect is lower than the log level in the log statement the correlator does not send the string to the log file. For example, if the log level in effect is ERROR (3) and the log level in the log statement is DEBUG (6) the correlator does not send the string to the log file since the log level in effect is lower than the log level in the log statement.
Suppose that a string expression in a log statement executes an action or has side effects. In this situation, the correlator executes the log statement so that side effects always take place. However, if the log level in effect is lower than the log level in the log statement the correlator still does not send the string to the log file.
Here are some examples where the log level in effect is WARN:
log "foo bar" at CRIT; // Sends "foo bar" to the log file.
log "foo bar" at INFO; // Does not send anything to the log file.
 
log "foo" + "bar" + 12345.toString() at INFO;
   // Does not send anything to the log file.
   // The expression in the log statement is evaluated even
   // though the log level is too low to send output to the log file.
 
log "foo" + bar() + 12345.toString() at INFO;
   // Does not send anything to the log file.
   // Calls bar() since that action might have side effects,
   // for example, the action could send an event.
To determine the log level in effect, the correlator checks whether you set a log level for the following in the order specified below:
1. The monitor or event that contains the log statement.
2. A parent of the monitor or event that contains the log statement. The correlator starts with the immediate parent and works its way up the tree as needed.
3. The correlator.
The log level in effect is the first log level that the correlator finds in the tree structure. See Setting logging attributes for packages, monitors and events in the Event Correlator Utilities Reference section of Deploying and Managing Apama Applications. If the correlator does not find a log level, the correlator uses the correlator’s log level. If you did not explicitly set the correlator’s log level, the default is INFO.
After the correlator identifies the applicable log level, the log level itself determines whether the correlator sends the log statement output to the appropriate log file as follows:
Log Level in Effect
For Log Statements With These Identifiers, the Correlator Sends the Log Statement Output to the Appropriate Log File
For Log Statements With These Identifiers, the Correlator Ignores Log Statement Output
OFF
None
CRIT, FATAL, ERROR, WARN, INFO, DEBUG, TRACE
CRIT
CRIT
FATAL, ERROR, WARN, INFO, DEBUG, TRACE
FATAL
CRIT, FATAL
ERROR, WARN, INFO, DEBUG, TRACE
ERROR
CRIT, FATAL, ERROR
WARN, INFO, DEBUG, TRACE
WARN
CRIT, FATAL, ERROR, WARN
INFO, DEBUG, TRACE
INFO
CRIT, FATAL, ERROR, WARN, INFO
DEBUG, TRACE
DEBUG
CRIT, FATAL, ERROR, WARN, INFO, DEBUG
TRACE
TRACE
CRIT, FATAL, ERROR, WARN, INFO, DEBUG, TRACE
None
An advantage of this framework is that there is no performance penalty for having log statements that do not specify actions in your application. You control the overhead of executing such log statements by specifying the appropriate log level.
Copyright © 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.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.