@Test public void testClose() throws Exception { File logFile = temporaryFolder.newFile("keyout.log"); KeyOutWriter writer = new KeyOutWriter( ImmutableList.<String>of(), true, false, logFile.getAbsolutePath(), null, null, null, null, ImmutableMap.<String, Object>of() ); writer.validateSetup(dummyServer(), dummyQuery()); Logger logger = writer.getLogger(logFile.getAbsolutePath()); assertThat(logger).isNotNull(); Iterator<Appender<ILoggingEvent>> appenderIterator = logger.iteratorForAppenders(); List<Appender<ILoggingEvent>> appenders = new ArrayList<Appender<ILoggingEvent>>(); while (appenderIterator.hasNext()) { appenders.add(appenderIterator.next()); } assertThat(appenders).hasSize(1); writer.close(); Appender<ILoggingEvent> appender = appenders.get(0); assertThat(appender.isStarted()).isFalse(); }
@Override public void close() { for(Logger logger: this.loggers.values()) { logger.detachAndStopAllAppenders(); } this.loggers.clear(); }
KeyOutWriter extends BaseOutputWriter { @Override public void close() { for(Logger logger: this.loggers.values()) { logger.detachAndStopAllAppenders(); } this.loggers.clear(); } }
KeyOutWriter extends BaseOutputWriter { @Override public void close() { for(Logger logger: this.loggers.values()) { logger.detachAndStopAllAppenders(); } this.loggers.clear(); } @JsonCreator  KeyOutWriter(
			@JsonProperty("typeNames") ImmutableList<String> typeNames,
			@JsonProperty("booleanAsNumber") boolean booleanAsNumber,
			@JsonProperty("debug") Boolean debugEnabled,
			@JsonProperty("outputFile") String outputFile,
			@JsonProperty("maxLogFileSize") String maxLogFileSize,
			@JsonProperty("maxLogBackupFiles") Integer maxLogBackupFiles,
			@JsonProperty("logPattern") String logPattern,
			@JsonProperty("delimiter") String delimiter,
			@JsonProperty("settings") Map<String, Object> settings); }
KeyOutWriter extends BaseOutputWriter { @Override public void close() { for(Logger logger: this.loggers.values()) { logger.detachAndStopAllAppenders(); } this.loggers.clear(); } @JsonCreator  KeyOutWriter(
			@JsonProperty("typeNames") ImmutableList<String> typeNames,
			@JsonProperty("booleanAsNumber") boolean booleanAsNumber,
			@JsonProperty("debug") Boolean debugEnabled,
			@JsonProperty("outputFile") String outputFile,
			@JsonProperty("maxLogFileSize") String maxLogFileSize,
			@JsonProperty("maxLogBackupFiles") Integer maxLogBackupFiles,
			@JsonProperty("logPattern") String logPattern,
			@JsonProperty("delimiter") String delimiter,
			@JsonProperty("settings") Map<String, Object> settings); @Override void validateSetup(Server server, Query query); @Override void internalWrite(Server server, Query query, ImmutableList<Result> results); @Override void close(); String getMaxLogFileSize(); Integer getMaxLogBackupFiles(); String getDelimiter(); String getOutputFile(); }
KeyOutWriter extends BaseOutputWriter { @Override public void close() { for(Logger logger: this.loggers.values()) { logger.detachAndStopAllAppenders(); } this.loggers.clear(); } @JsonCreator  KeyOutWriter(
			@JsonProperty("typeNames") ImmutableList<String> typeNames,
			@JsonProperty("booleanAsNumber") boolean booleanAsNumber,
			@JsonProperty("debug") Boolean debugEnabled,
			@JsonProperty("outputFile") String outputFile,
			@JsonProperty("maxLogFileSize") String maxLogFileSize,
			@JsonProperty("maxLogBackupFiles") Integer maxLogBackupFiles,
			@JsonProperty("logPattern") String logPattern,
			@JsonProperty("delimiter") String delimiter,
			@JsonProperty("settings") Map<String, Object> settings); @Override void validateSetup(Server server, Query query); @Override void internalWrite(Server server, Query query, ImmutableList<Result> results); @Override void close(); String getMaxLogFileSize(); Integer getMaxLogBackupFiles(); String getDelimiter(); String getOutputFile();  }