0

I have a 3-th party jars that integrated with log4j.

I have as well GUI that control the application and i want to trigger command from the GUI and getting the log results.

Only while this command is execute by the GUI i want to bind to the system.out stream and keep all the logging info into a string buffer, by the end of this process i would like to send this string buffer back to the GUI.

Is there any way to bind during runtime into the System.out and enable and disable it ?

USer22999299
  • 5,284
  • 9
  • 46
  • 78
  • Do you mean you want to write everything that was logged using `log4j` into the `System.out` stream or do you want to replace the `System.out` stream to get the generated output? If it is the first one, then I guess my answer is not the one you're looking for ... – Tom Aug 01 '15 at 06:57
  • 1
    @Tom I would like to use the current log4j configuration and when ever i want to "capture" the logs, to enable the above request and bind somehow to the output and getting the StringBuffer of the captured logs, and to be able to disable it when ever i want – USer22999299 Aug 01 '15 at 07:03
  • 1
    Oh ok, then my answer is incorrect for that purpose. Too bad. Maybe someone else knows how to do that :). – Tom Aug 01 '15 at 07:04
  • after a quick search found a quick solution here http://stackoverflow.com/a/6103091/1161594 – USer22999299 Aug 01 '15 at 07:11

0 Answers0