Search in sources :

Example 21 with LogRecord

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");
        }
    }
}
Also used : LogRecord(com.sun.identity.log.LogRecord)

Aggregations

LogRecord (com.sun.identity.log.LogRecord)21 SSOToken (com.iplanet.sso.SSOToken)14 IOException (java.io.IOException)9 LogMessageProvider (com.sun.identity.log.messageid.LogMessageProvider)5 Logger (com.sun.identity.log.Logger)4 SSOException (com.iplanet.sso.SSOException)3 AMLogException (com.sun.identity.log.AMLogException)3 Level (java.util.logging.Level)2 Response (com.iplanet.services.comm.share.Response)1 SSOTokenManager (com.iplanet.sso.SSOTokenManager)1 AuthContext (com.sun.identity.authentication.AuthContext)1 AuthLoginException (com.sun.identity.authentication.spi.AuthLoginException)1 ELogRecord (com.sun.identity.entitlement.log.ELogRecord)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 AccessDenied (com.sun.identity.idsvcs.AccessDenied)1 GeneralFailure (com.sun.identity.idsvcs.GeneralFailure)1 LogResponse (com.sun.identity.idsvcs.LogResponse)1 SsoServerLoggingHdlrEntryImpl (com.sun.identity.monitoring.SsoServerLoggingHdlrEntryImpl)1 SsoServerLoggingSvcImpl (com.sun.identity.monitoring.SsoServerLoggingSvcImpl)1 LogException (com.sun.identity.plugin.log.LogException)1