public void onMessage(String message) {
            history.add(message);
            try {
                OutputStream out = reportFactory.openReport();
                BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out));
                for (String crnt : history) {
                    writer.write(crnt);
                    writer.newLine();
                }
                writer.flush();
                writer.close();
            } catch (IOException e) {
                throw new RuntimeException("Unable to log message", e);
            }
       }