Apama 10.3.1 | Apama Documentation | Deploying and Managing Apama Applications | Correlator Utilities Reference | Configuring the correlator | Setting EPL log files and log levels in a YAML configuration file
 
Setting EPL log files and log levels in a YAML configuration file
This topic describes how to configure logging for individual EPL packages. For information about configuring the log level of the whole correlator and plug-ins running inside it, see Setting correlator and plug-in log levels in a YAML configuration file.
You can configure per-package logging in several ways:
*Statically, in the YAML configuration file when starting the correlator, as described in this topic.
*Dynamically, using the following options of the engine_management tool:
--setApplicationLogFile
--setApplicationLogLevel
See Setting EPL log files and log levels dynamically for detailed information.
*Dynamically from within EPL. See Using the Management interface for detailed information.
To set log files and/or log levels for EPL root, packages, monitors, or events, specify entries in the eplLogging section of the YAML configuration file.
To set the default log file and level for the EPL root package, specify this in the following format:
eplLogging:
.root:
file: rootLogFilename
level: ROOTLOGLEVEL
Replace rootLogFilename with the name of the log file for the EPL root package. No spaces are allowed in the log file name. Replace ROOTLOGLEVEL with TRACE, DEBUG, INFO, WARN, ERROR, FATAL, CRIT or OFF. For example:
eplLogging:
.root:
file: apama/root.log
level: ERROR
You do not need to specify both a log file and a log level; you can specify one or the other. If you do not specify a log file or log level for the root package, it defaults to the correlator's log file/log level.
To set the default log file and level for an EPL package, monitor or event, specify this in the following format:
eplLogging:
  node:
file: nodeLogFilename
level: NODELOGLEVEL
Replace node with the name of the EPL package, monitor, or event for which you are setting the logging attribute. If a monitor or event is in a named package and not the root package, be sure to specify the fully qualified name. Replace nodeLogFilename with the name of the default log file for the specified EPL package, monitor or event. No spaces are allowed in the log file name. Replace NODELOGLEVEL with TRACE, DEBUG, INFO, WARN, ERROR, FATAL, CRIT or OFF. This is the default log level for the specified node. For example:
eplLogging:
com.myCompany.Client:
file: apama/Client.log
level: DEBUG
com.myCompany.Internal: { level: ERROR }
The above example shows both multi-line and single-line syntax. The single-line syntax is more compact when you are just setting either the log level or the file, but not both.
For a particular node, you do not need to specify both a log file and a log level; you can specify one or the other. If you do not specify a log file or log level for a particular node, it defaults to the settings for a parent node. See Tree structure of packages, monitors, and events.
When you set log attributes in the YAML configuration file, the rules for hierarchical logging apply. See Setting EPL log files and log levels dynamically.
If you pass a YAML configuration file to a correlator when you start that correlator and the configuration file contains an eplLogging section, the correlator uses the logging settings in that section. If you do not pass a configuration file when you start a correlator, or there are no settings in the eplLogging section, then correlator initialization does not include any log settings except for the default correlator log.
Whether or not you specify a YAML configuration file when you start a correlator, any log settings you specify can be overwritten after initialization by invoking the engine_management tool and specifying the --setApplicationLogFile and/or --setApplicationLogLevel options. See Managing EPL log levels and Managing EPL log files.
Note: Regularly rotating log files and storing the old ones in a secure location may be important as part of your personal data protection policy. For more information, see Recommendations for logging by Apama application code.

Copyright © 2013-2019 | 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.