I was wondering if there is a way to save the output displayed on the Java console to a file? Unfortunately for the situation I'm testing updating the code is not an option so it would have to be a setting or something I can change.
A web search only ever seems to reveal code changes to make
The Java console meaning JConsole, or meaning the OS console window (CMD.EXE) ? If it's the latter, the answer varies by OS, of course, but generally there's a way of cutting and pasting out of that window and into a file. For example, in Windows, if you enable "Smart Edit" in the Properties tab for your consoles, then you can rightclick-drag across text to select it. Furthermore, the same Properties wizard lets you set the scrollback of the window so that lines that scroll off the screen don't disappear.
If you mean JConsole, screenshots are about the best you can do, I think.
Use > in the console to redirect the standard output, use 2> to redirect the standard error output:
To merge the standard output and error output redirect the error output to the standard output (it must be put after the standard output redirection or it will redirect to the old standard output - the console):
The console I mean is the one which is shown when you web-start an application (picture attached). Unfortunately a screenshot isn't possible in this case because I'm trying to get some logging from my application at the moment of shutdown (when unfortunately the Java console dissapears also).
I need to capture logging at the point my application exits. This exits the JVM too (System.exit()) and the console then dies so I do not have time to do the copy.
A way to make the console persist after the application which started it would be helpful too if it is not possible to have it automatically written to a file somewhere.
The log file is saved as "plugin#####.log" in C:\Documents and Settings\[your login]\Application Data\Sun\Java\Deployment\log.
Frank Nguyen
Greenhorn
Joined: Mar 11, 2010
Posts: 2
posted
0
A new plugin log file will be generated every time you open a new browser. You just need to get the latest one, read lines, and collect your outputs or any exceptions.
Frank Nguyen wrote:A new plugin log file will be generated every time you open a new browser. You just need to get the latest one, read lines, and collect your outputs or any exceptions.