+

Search Tips   |   Advanced Search

Example: Sample security policy for logging


Set up a security policy to allow the 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 the application if we want the 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:

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

//

// WAS Security Policy

//

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//


//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

// Allow all access to the file system and runtime classes

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// 
grant codeBase "file:${application}" {
   permission java.util.logging.LoggingPermission "control";
};





 

Related tasks


Set Java logging
Add logging and tracing to the application