I am wanting to pipe the Java console output (generated by System.out.println and its ilk) to a file. I found an excellent solution here to enable Java tracing,
System.out.println
If you want to run the problem in the background, do this -
nohup java -jar yourprogram.jar > log.txt 2>&1 &