ADDITIVITY Attribute

Specifies whether to pass a log event only to the appender that is associated with the logger or to the appenders in the logger's hierarchy.
Applies to: logger object

Syntax

object.ADDITIVITY = "TRUE | FALSE";

Required Arguments

object
specifies the name of the logger object.
"TRUE | FALSE"
determines whether a log event is processed by the appenders that exist in the specified logger's hierarchy.
Default TRUE

Details

By default, each log event is passed to the appenders that are associated with the logger and to the appenders that are associated with the logger's hierarchy. This is the meaning of the term appender additivity.
For example, by default, when a log event is processed by the logger Testing.MyProg.TraceMsgs, the log message is also directed to the appenders that are referenced in the Testing.MyProg and Testing loggers. If ADDITIVITY=FALSE, the log message is directed to only the appenders that are referenced by Testing.MyProg.TraceMsgs.
Note: You can also specify the logger additivity in the logger's constructor by using the DECLARE statement. For more information, see DECLARE Statement, Logger Object.

Example

The following code sets the additivity attribute to FALSE.
data _null_;
   if _n_ = 1 then do;
      declare logger logobj("mylog");
   end;
   logobj.additivity="false";
run;
Alternatively, you can set the additivity attribute in the DECLARE statement.
data _null_;
   if _n_ = 1 then do;
      declare logger logobj("mylog", additivity:"false");
   end;
run;

See Also