view src/goodjava/logger/ListAppender.java @ 1515:78d937870762

Thread.synchronized
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 30 May 2020 17:58:35 -0600
parents 85d7c1777357
children
line wrap: on
line source

package goodjava.logger;


public final class ListAppender implements Appender {
	private final Appender[] appenders;

	public ListAppender(Appender... appenders) {
		this.appenders = appenders;
	}

	public synchronized void append(LoggingEvent event) {
		for( Appender appender : appenders ) {
			appender.append(event);
		}
	}

	public void close() {
		for( Appender appender : appenders ) {
			appender.close();
		}
	}
}