0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan/*
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * The contents of this file are subject to the terms of the Common Development and
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * Distribution License (the License). You may not use this file except in compliance with the
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * License.
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan *
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * specific language governing permission and limitations under the License.
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan *
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * When distributing Covered Software, include this CDDL Header Notice in each file and include
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * Header, with the fields enclosed by brackets [] replaced by your own identifying
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * information: "Portions Copyrighted [year] [name of copyright owner]".
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan *
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan * Copyright 2014 ForgeRock AS. All rights reserved.
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan */
0b03f6a75c899702be840c5d00531d234bcb0810Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganpackage org.slf4j.impl;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganimport org.forgerock.openam.slf4j.AMLoggerFactory;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganimport org.slf4j.ILoggerFactory;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganimport org.slf4j.spi.LoggerFactoryBinder;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan/*
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk HoganTODO: look into the REQUESTED_API_VERSION string to participate in the slf4j version check version. It is currently not
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganincluded as we don't want to update the code when we move to a newer version of slf4j. Not having the version string
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganmeans that we might skew with slf4j-api updates. See http://slf4j.org/faq.html, version check mechanism section.
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan */
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hoganpublic class StaticLoggerBinder implements LoggerFactoryBinder {
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan public static final StaticLoggerBinder getSingleton() {
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan return SINGLETON;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan }
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan private static final String loggerFactoryClassStr = AMLoggerFactory.class.getName();
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan private final ILoggerFactory loggerFactory;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan private StaticLoggerBinder() {
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan loggerFactory = new AMLoggerFactory();
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan }
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan public ILoggerFactory getLoggerFactory() {
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan return loggerFactory;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan }
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan public String getLoggerFactoryClassStr() {
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan return loggerFactoryClassStr;
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan }
f38706c3921a6bb47ba4bbe177d1a7da432368e1Dirk Hogan}