Logging configuration (optional)
The optional <logging> and <plugin-logging> elements define the logging configuration used by the adapter. If present, they must appear as the first elements nested in the <adapter-config> element.
The <logging> element configures the logging for the IAF itself, whereas the <plugin-logging> element configures logging for the transport and codec layer plug-ins in the adapter.
Both elements have two attributes:
The
level attribute sets the logging verbosity level; it must be one of the strings
TRACE,
DEBUG,
INFO,
WARN,
ERROR,
FATAL,
CRIT, or
OFF (with the same case).
The
file attribute determines the file that logging messages will be written to. This should be a file path relative to the directory that the adapter was started from, or one of the special values
stdout or
stderr which to log to standard output or standard error, respectively.
If the IAF cannot write to the specified log file, the adapter will fail to start.
Note: If the --logfile and --loglevel options are passed to the IAF executable when this is run, the <logging> and <plugin-logging> elements are ignored.
An example of these elements is provided below:
<adapter-config>
<logging level="INFO" file="iaf.log" />
<plugin-logging level="DEBUG" file="plugins.log" />
...
</adapter-config>
If logging is not configured explicitly in the configuration file or with command line options, logging defaults to the INFO level on the standard error stream.
The <logging> element accepts two optional sub-elements, <upstream-events> and <downstream-events> that can be configured to log details of all events sent to and received from a connected correlator, without needing to set the entire IAF to DEBUG level logging. These sub-elements each take a single attribute (level) whose values specifies the logging level to be used to log upstream and downstream events, respectively. If this log level is equal to or greater than the IAF logging level, details of the events will appear in the IAF log file. For example:
<logging level="WARN">
<upstream-events level="ERROR"/>
<downstream-events level="INFO"/>
</logging>
In this configuration, upstream events will be logged (because ERROR is greater than WARN) but downstream events will not (because INFO is less than WARN). If either of the upstream or downstream event logging levels is not explicitly set, it will default to DEBUG (so events will not be logged by default, unless the IAF is explicitly configured for DEBUG logging).