0

我有一个 FileAppender,通常事件是通过 Append(LoggingEvent loggingEvent) 方法登录的,所以每次只有一个事件。我有一个问题,在哪些情况下会调用 Append(LoggingEvent[] loggingEvents) 方法?我知道当有一系列事件要记录时,但我的问题是,我如何模拟一系列事件的情况?为了调用 FileAppender.Append(LoggingEvent[] loggingEvents) 必须发生什么?

4

1 回答 1

0

You are right: if you use "just" a FileAppender each event is logged via the Append(LoggingEvent) method.

The other method call is fired when you are buffering events via, for example, the BufferingForwardingAppender: it will keep events in memory until some conditions are met, then it will call Append(LoggingEvent[]) on its inner appenders.

于 2014-03-08T18:22:53.873 回答