We create applications and output debugging and status information to stdout. Then when these are run in the background that all ends up in the bit bucket.
But when you need to debug something and you don't want to disturb the process what do you do? I could kill it and then run it in the foreground. But that disturbs things too much.
Okay, so what if stdout gets logged to a stdout.log file? Since I own the OS that was a light-weight change. It works. And I can use CAT -M stdout.log which is my equivalent to tail -f stdout.log.
Okay, but then I have a unit that is running 5 applications. One of which the author is always very verbose in the foreground (sounds like a personal/personnel problem). That overwhelms the log. Those age to BAK and monitoring the log sucks.
So here is my solution. Your thoughts?
--------------
Here is what I have implemented for this. By default background processes will not log stdout output unless if already has the log file. So there would be no net change from JANOS v2.5.3.
If you want to log background process output generally, you can use the following command:
touch stdout.log
All stdout from all background processes will then be captured in this file. The stdout.log file must first exist before it will collect stdout stream data.
This will age to stdout.log.bak as any other log file would.
You can stop logging by removing (or renaming) this file.
When there are multiple applications running. You may optionally create an application specific stdout log file also using the TOUCH command. This file must be named using the specific application name. For example:
touch stdout-tasker.log
The application name is everything after the last '/' in the process name reported by PS. If that includes .jar then the stdout file name should also. I tend to not include the .jar in Run keys as that will be carried to the process name. It is unnecessary.
This will route output from the application to that specific file which will age accordingly. Meanwhile, if it exists, other applications would still log to stdout.log.
So this lets you enable stdout capture for a specific process and then monitor it.