Printing Security System Trace Messages

By setting the system property java.security.debug to all, the security system will print details of security related calls. The value all prints all available debugging information. For finer control of what is printed, see:
http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/debugger.html#jsdp
Here's an example of setting the system property on the command line:
java -Djava.security.debug=all MyApp
Here's a sample of trace messages:
access: access allowed (java.io.FilePermission c:\file1 read) access: access allowed (java.io.FilePermission c:\file2 write) access: access denied (java.util.PropertyPermission user.home read) Exception in thread "main" java.security.AccessControlException: access denied ( java.util.PropertyPermission user.home read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270) at java.security.AccessController.checkPermission(AccessController.java:401) at java.lang.SecurityManager.checkPermission(SecurityManager.java:542) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291) at java.lang.System.getProperty(System.java:572) at MyApp.main(MyApp.java:50)

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.