You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2005/04/28 18:22:27 UTC

cvs commit: logging-log4j/src/java/org/slf4j/impl Log4jLoggerFA.java

ceki        2005/04/28 09:22:27

  Added:       src/java/org/slf4j/impl Log4jLoggerFA.java
  Log:
  
  
  Revision  Changes    Path
  1.1                  logging-log4j/src/java/org/slf4j/impl/Log4jLoggerFA.java
  
  Index: Log4jLoggerFA.java
  ===================================================================
  /*
   * Copyright 1999,2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.slf4j.impl;
  
  import org.apache.log4j.LogManager;
  import org.apache.ugli.LoggerFactoryAdapter;
  import org.apache.ugli.ULogger;
  
  /**
   * This factory adapter relies on log4's {@link LogManager} to do its job.
   * 
   * @author Ceki Gülcü
   *
   */
  public class Log4jLoggerFA implements LoggerFactoryAdapter {
  
    public Log4jLoggerFA() {
    }
  
    /**
     * Get a {@link ULogger} by name, by delegating all work to log4's 
     * {@link LogManager}.
     * 
     * <p>The implementation is trivial because log4j 
     * {@link org.apache.log4j.Logger loggers} directly implement the 
     * {@link ULogger} interface.
     */
    public ULogger getLogger(String name) {
      return LogManager.getLogger(name);  
    }
  
    /**
     * Get a {@link ULogger} by domain and subdomain name, by delegating all work 
     * to log4's {@link LogManager}.
     * 
     * <p>The implementation is trivial because log4j 
     * {@link org.apache.log4j.Logger loggers} directly implement the 
     * {@link ULogger} interface.
     */
    public ULogger getLogger(String domainName, String subDomainName) {
      return LogManager.getLogger(domainName);  
    }
  }
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org