I wrote a custom Java server. I am running it using Upstart (/etc/init/myservice.config
) where I launch java -jar myservice.jar
.
The java process uses System.out.println
to write log messages of all kinds.
I want to be able to connect to it from a remote ssh session and view the output.
UPDATE: I want to do this without the hassle of creating, rotating, managing log files.
I've looked at a number of posts, including: How to view the output of a running process in another bash session?
I've tried cat
and tail -f /proc/<procid>/fd/0 /proc/<procid>/fd/1 /proc/<procid>/fd/2
— all are blank output.
All this is as root
I know there are more things to try, but I'm suspicious since the fd's are blank (or at least for me).
Im running Ubunutu Server 14.04 LTS, Oracle Java 8
Update: Looking to try screen, but I see its not exactly meant for this... How do I start a screen session using an upstart job with a non privileged user?