001/* 002 * (C) Copyright 2006-2009 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Nuxeo - initial API and implementation 016 * 017 * $Id$ 018 */ 019 020package org.nuxeo.runtime.jetty; 021 022import org.apache.commons.logging.Log; 023import org.mortbay.log.Logger; 024 025/** 026 * Dumb logger to see what happens in Jetty. 027 * 028 * @author Thierry Delprat 029 */ 030public class Log4JLogger implements Logger { 031 032 protected final Log logger; 033 034 public Log4JLogger(Log logger) { 035 this.logger = logger; 036 } 037 038 @Override 039 public void debug(String msg, Throwable th) { 040 logger.debug(msg, th); 041 } 042 043 @Override 044 public void debug(String msg, Object arg0, Object arg1) { 045 logger.debug(String.format(msg, arg0, arg1)); 046 } 047 048 @Override 049 public Logger getLogger(String name) { 050 return this; 051 } 052 053 @Override 054 public void info(String msg, Object arg0, Object arg1) { 055 logger.info(String.format(msg, arg0, arg1)); 056 } 057 058 @Override 059 public boolean isDebugEnabled() { 060 return logger.isDebugEnabled(); 061 } 062 063 @Override 064 public void setDebugEnabled(boolean enabled) { 065 } 066 067 @Override 068 public void warn(String msg, Throwable th) { 069 logger.warn(msg, th); 070 } 071 072 @Override 073 public void warn(String msg, Object arg0, Object arg1) { 074 logger.warn(String.format(msg, arg0, arg1)); 075 } 076 077}