1

I am running a dynamic spring MVC project. I am including some jar files/packages in my project to convert DNS lookup.

I am getting console Outputs (System.out.println()) which is written in jar file.It is the status of my DNS conversions.

Some of the final outputs I show in UI through Model Attribbute

I need To show that console messages which is printed from a jar file in my GUI. How can I do this? Any Idea ?

Sri
  • 1,505
  • 2
  • 18
  • 35
  • 1
    possible duplicate [redirect-console-output-to-string-in-java](http://stackoverflow.com/questions/8708342/redirect-console-output-to-string-in-java) – linski Dec 11 '13 at 13:24
  • in my question the Sysout is in jar file. How could I set ByteArrayOutputStream in a jar file? @linski – Sri Dec 11 '13 at 13:31
  • try as provided in the link, notice that [System.out](http://docs.oracle.com/javase/7/docs/api/java/lang/System.html) is static. – linski Dec 11 '13 at 13:37

1 Answers1

0

I would go with SLF4J to clean up all your logging. Something like the below link should work and you can re-direct any other logging (log4j, commons-io ect) using the other slf4j logging dependencies.

http://projects.lidalia.org.uk/sysout-over-slf4j/quickstart.html

Stephen Dillon
  • 775
  • 7
  • 12