Previous Page | Next Page

Logger and Appender Object Language Reference

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
Arguments
Details
Example
See Also

Syntax

object.ADDITIVITY = "TRUE" | "FALSE";


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, assume that you have a logger, CONSOLE. The output of a log event of logger CONSOLE goes to all of the appenders that are in CONSOLE and its ancestors. However, if an ancestor of logger CONSOLE, say FILE, has the additivity flag set to FALSE, then CONSOLE's output is directed to all of the appenders that are in CONSOLE and its ancestors up to and including FILE, but not to the appenders that are in any of the ancestors of FILE.

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.  [cautionend]


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

Statement:

DECLARE Statement, Logger Object

Previous Page | Next Page | Top of Page