use of com.sun.identity.idsvcs.LogResponse in project OpenAM by OpenRock.
the class IdentityServicesImpl method log.
@Override
public LogResponse log(Token app, Token subject, String logName, String message) throws AccessDenied, TokenExpired, GeneralFailure {
if (app == null) {
throw new AccessDenied("No logging application token specified");
}
SSOToken appToken;
SSOToken subjectToken;
appToken = getSSOToken(app);
subjectToken = subject == null ? appToken : getSSOToken(subject);
try {
LogRecord logRecord = new LogRecord(java.util.logging.Level.INFO, message, subjectToken);
//TODO Support internationalization via a resource bundle specification
Logger logger = (Logger) Logger.getLogger(logName);
logger.log(logRecord, appToken);
logger.flush();
} catch (AMLogException e) {
debug.error("IdentityServicesImpl:log", e);
throw new GeneralFailure(e.getMessage());
}
return new LogResponse();
}
Aggregations