I need to save console output from application, started via JNLP, to some file on user machine (for example, to examine verbose jvm output, or to do quick-and-dirty logging). The application is granted all permissions.
Is that possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are some different scenarios:
If you have control over the Client machine executing the app, you can go with serg10’s example and enable traces in the control panel.
If you can change the code, you may use:
System.setOut(new PrintStream(new FileOutputStream(fileName)));
To do logging to a file of your choise, use FileOutputStream with appender constructor:
http://docs.oracle.com/javase/6/docs/api/java/io/FileOutputStream.html#FileOutputStream%28java.io.File,%20boolean%29