use of com.sun.identity.log.LogRecord in project OpenAM by OpenRock.
the class PolicyEvaluator method logAccessMessage.
/**
* Logs an access message from policy client api
* @param level logging level
* @param message message string
* @param token single sign on token of user
*/
private void logAccessMessage(Level level, String message, SSOToken token) {
try {
if (accessLogger == null) {
accessLogger = (com.sun.identity.log.Logger) Logger.getLogger("amRemotePolicy.access");
if (accessLogger == null) {
if (debug.warningEnabled()) {
debug.warning("PolicyEvaluator.logAccessMessage:" + "Failed to create Logger");
}
return;
}
}
LogRecord lr = new LogRecord(level, message, token);
accessLogger.log(lr, appSSOToken);
} catch (Throwable ex) {
if (debug.warningEnabled()) {
debug.warning("PolicyEvaluator.logAccessMessage:Error" + " writing access logs");
}
}
}
Aggregations