0

Is it possible to, and if so how do you get programmatic access to the Java Console Log generated by Java applets?

What I want to do is add a "post bug" button to the applet I am developing. When testers click this button I would like the applet to then package up the contents of the console log as part of a bug report submitted by the applet.

Thanks for any help.

Pryo
  • 690
  • 1
  • 10
  • 24

2 Answers2

1

You can append log messages to a StringBuffer object, and show in Textfield on the click of a button.

Saurabh Saxena
  • 1,327
  • 2
  • 13
  • 26
1

Using System.setOut and setErr you can capture output that would otherwise go to the console.

Garrett Hall
  • 29,524
  • 10
  • 61
  • 76
  • I spent ages searching for this question on here before I asked it. Only now do I find the question and answer here too: [link](http://stackoverflow.com/questions/5389632/capturing-contents-of-standard-output-in-java) – Pryo Oct 22 '11 at 18:07