In simple terms what is the result of making additivity="true"
or additivity="false"
when adding a Log4j configuration for a specific class like this?
<Logger name="com.mypage.glass.TryWindow" level="INFO" additivity="true">
<AppenderRef ref="console"/>
<AppenderRef ref="file"/>
</Logger>
By default, a logger inherits the appenders from its ancestors. By setting additivity="false"
, you prevent this behaviour.
In your example, there may be appenders associated with com.mypage.glass
or com.mypage
or even the root logger that would be inherited if you don't set that property to false
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.