/** * Calling this method redirects the logging of this Java object which is available through the * field 'out' to a known file. * * @param logFile * @throws IOException */ protected void setLoggingFile(File logFile, boolean append) throws IOException { if (!logFile.exists()) logFile.createNewFile(); this.out = new PrintStream( new BufferedOutputStream(new FileOutputStream(logFile, append)), true, "UTF-8"); broadcaster.setLoggingStream(out); }
/** * Notify any clients of the beans status * * @param bean */ @Override public void broadcast(StatusBean tbean) { try { bean.merge(tbean); cancelMonitor(); broadcaster.broadcast(bean, false); } catch (Exception e) { logger.error("Cannot broadcast", e); } }