0

I am running a java process in the background. It prints out the log through system.out. It is supposed to run for a long time, so I can't stop it now. It is running on the CentOS 6.

Is there a command to capture the output from a java process running in the background?

thanks.

user826323
  • 2,248
  • 6
  • 43
  • 70
  • When you start it, you can redirect the output to a file then tail that file. If you've already started it and can't restart it, I don't know a way to change the output pipe – Dave May 17 '14 at 15:55
  • I forgot adding a pipe.. I can't stop it now, because it's supposed to run for a long time. If I stop, I have to start from the beginning. – user826323 May 17 '14 at 16:03
  • Suggest you try asking on http://unix.stackexchange.com/ (or maybe http://serverfault.com/ or http://superuser.com/) – Dave May 17 '14 at 16:10

1 Answers1

0

It doesn't matter that it's Java, the problem is just to capture the stdout of a running process in Linux, and a quick search produces this: How can a process intercept stdout and stderr of another process on Linux?.

Community
  • 1
  • 1
John Bickers
  • 481
  • 2
  • 6