Andy897
Andy897

Reputation: 7133

log4j2 overriding close method in custom appenders

In log4j-1, we required override close() method.

@Override public void close(){ ..... }

But that does not seem to be the case in log4j2.

Any thoughts on why this is so?

Upvotes: 1

Views: 495

Answers (1)

Remko Popma
Remko Popma

Reputation: 36754

Log4j2's Appender interface extends Lifecycle which has a stop() method that is called when the logging subsystem shuts down. This is where you would release any resources.

Upvotes: 1

Related Questions