Example: Sample security policy for logging

Set up a security policy to allow your applications to modify logging and handler properties.

The sample security policy that follows grants access to the file system and runtime classes. Include this security policy, with the entry permission java.util.logging.LoggingPermission "control", in the META-INF directory of your application if you want your applications to programmatically alter controlled properties of loggers and handlers. The META-INF file is located in the following locations for the different module types:

EJB projects ejbModule/META-INF/MANIFEST.MF
Application client projects appClientModule/META-INF/MANIFEST.MF
Dynamic Web projects WebContent/META-INF/MANIFEST.MF
Connector projects connectorModule/META-INF/MANIFEST.MF

Below is a sample security policy that grants permission to modify logging properties:

//////////////////////////////////////////////////
//
// WebSphere Application Server Security Policy
//
//////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
// Allow all access to the file system and runtime classes
////////////////////////////////////////////////////////////////////////
grant codeBase "file:${application}" {
   permission java.util.logging.LoggingPermission "control";
};



Related tasks
Configuring Java logging using the administrative console
Adding logging and tracing to your application
Reference topic    

Terms of Use | Feedback

Last updated: Feb 19, 2011 5:25:36 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v610web&product=was-nd-mp&topic=rtrb_logsecuritysamp
File name: rtrb_logsecuritysamp.html