The information in this article applies to:
This article describes two methods that can redirect output from jview or wjview.
Unfortunately, there is not an option or registry setting for jview or wjview that enables Java logging. However, you can redirect the output when invoking an application like the following example:
jview main > javalog.txt
This works for both jview and wjview.
Or you can programmatically direct the output to a file or pipe by reassigning System.out. The following steps, which work for jview or wjview and Internet Explorer, show how this can be done:
// // sample.java // import java.io.*; public class sample { public static void main(String[] args) { if ("true".equalsIgnoreCase(System.getProperty ("com.ms.applet.enable.logging"))) { try { String logdir = System.getProperty("java.home"); PrintStream ps = new PrintStream(new BufferedOutputStream (new FileOutputStream(new File (logdir,"javalog.txt"))), true); // Use the following two lines for SDK 1.5 and 1.5.1: // System.out = ps; // comment line if using SDK 2.0 // System.err = ps; // comment line if using SDK 2.0 // Otherwise, use the following two lines for SDK 2.0 and greater: System.setOut(ps); // uncomment line if using SDK 2.0 System.setErr(ps); // uncomment line if using SDK 2.0 } catch (Exception e) { } System.out.println("sample.java executed successfully!"); } } }
Javalog.txt should contain the line: "sample.java executed successfully!".
Note Javalog.txt is normally found in your Windows directory at %Windir%\Java\Javalog.txt.
The ability to alter the value of System.out and other system streams may be removed or changed in the future.
For additional information, please see the following articles in the Microsoft Knowledge Base:
Q177177 HOWTO: Enabling Messages Printed Using System.out.println
Q173469 How to Enable the Javalog.txt File
For the latest Knowledge Base articles and other support information on Microsoft® Visual J++® and the SDK for Java, please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/