8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: LoggerFactory.java,v 1.2 2009/10/22 21:04:36 veiming Exp $
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington * Portions Copyrighted 2015 ForgeRock AS.
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestimport org.forgerock.openam.entitlement.PolicyConstants;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This factory returns the logger object (java.util.logging.Logger or its
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * super class). This factory instantiates a class that is set in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "com.sun.identity.log.loggerprovider" system property. And this class
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * is responsible for returning the Logger object. com.sun.identity.log.Logger
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * will be returned if this system property is not set. Otherwise,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * java.util.logging.LogManager.getLogManager.getLogger will be returned if
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * com.sun.identity.log.Logger is absent.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static LoggerFactory instance = new LoggerFactory();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((prop != null) && (prop.trim().length() > 0)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "com.sun.identity.log.LoggerProvider");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private ILoggerProvider getLoggerProvider(String className) {
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest PolicyConstants.DEBUG.error("LoggerFactory.<init>", ex);
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest PolicyConstants.DEBUG.error("LoggerFactory.<init>", ex);
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest PolicyConstants.DEBUG.error("LoggerFactory.<init>", ex);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns logger object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param name Name of logger.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return logger object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (provider != null) ? provider.getLogger(name)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns logger object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param name Name of logger.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return logger object.