How do you turn on logging in java 5?

Webstart used to be so easy to turn on logging - you’d go to preferences, and lo and behold there was a field to type where you wanted to log to, and if you wanted to log or not (checkbox).

Now, as part of Sun’s bid to make java successively worse in each new release :wink: :stuck_out_tongue: all that has gone.

There’s nothing about this in Sun’s JWS docs on the docs linked to from java.sun.com (they dont list it on the “enhancements” page either).

I also find the loss of webstart annoying ( It took me a while to find out how to delete downloaded apps. )

You can turn logging on in windows by opening Control Panel and clicking on the Java Icon, then Advanced Tab, the expand the debugging tree. However there doesn’t appear to be any way of specifying where it goes.

Alan

um…do you know where it does go, then? ???

Similar to tracing, logging is a facility to redirect any output in the Java Console to a log file using the Java Logging API. Logging can be turned on by enabling the property javaplugin.logging:

-Djavaplugin.logging=true

Other Options
File Names

The names of the trace and log files are

plugin<modified version number>.trace
plugin<modified version number>.log

where the includes the major, minor and patch version numbers; e.g., plugin142_06.trace or plugin150.log
File Locations

The default location (directory) of the trace and log files is:

* <user.home>/.java/deployment/log on Unix/Linux
* <User Application Data Folder>\Sun\Java\Deployment\log on Windows

where is as defined here.

If the environment variable USER_JPI_PROFILE is set to then the trace and log files will be written to:

* <user plugin home>/.java/deployment/log on Unix/Linux
* <user plugin home>\Sun\Java\Deployment\log on Windows

If the property javaplugin.outputfiles.path is set to then the trace and log files will be written to .

If both USER_JPI_PROFILE and javaplugin.outputfiles.path are set then the value of javaplugin.outputfiles.path takes precedence, and the trace and log files will be written to .

Unfortunately, in Java 5, this doesn’t work like it used to.

Be warned: the full system.out and .err logging you came to know and love has been removed by Sun for Java 5, so you can’t just debug webstart apps like you used to be able to. Go figure.

(tested with 1.5.0_04 - it will log anything in applets, but nothing in webstart; could be a regression bug)