Mercurial Hosting > luan
changeset 820:8e9db0bbf4f9
remove org.eclipse.jetty.util.log and upgrade slf4j
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/AbstractGenerator.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/http/AbstractGenerator.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,8 +26,8 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.View; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -40,7 +40,7 @@ */ public abstract class AbstractGenerator implements Generator { - private static final Logger LOG = Log.getLogger(AbstractGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractGenerator.class); // states public final static int STATE_HEADER = 0;
--- a/src/org/eclipse/jetty/http/HttpContent.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpContent.java Tue Sep 13 23:13:06 2016 -0600 @@ -23,8 +23,8 @@ import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.ByteArrayBuffer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.Resource; /* ------------------------------------------------------------ */ @@ -49,7 +49,7 @@ /* ------------------------------------------------------------ */ public class ResourceAsHttpContent implements HttpContent { - private static final Logger LOG = Log.getLogger(ResourceAsHttpContent.class); + private static final Logger LOG = LoggerFactory.getLogger(ResourceAsHttpContent.class); final Resource _resource; final Buffer _mimeType;
--- a/src/org/eclipse/jetty/http/HttpFields.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpFields.java Tue Sep 13 23:13:06 2016 -0600 @@ -49,8 +49,8 @@ import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringMap; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -63,7 +63,7 @@ */ public class HttpFields { - private static final Logger LOG = Log.getLogger(HttpFields.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpFields.class); /* ------------------------------------------------------------ */ public static final String __COOKIE_DELIM="\"\\\n\r\t\f\b%+ ;="; @@ -1093,7 +1093,7 @@ } catch (Exception e) { - LOG.warn(e); + LOG.warn("",e); return e.toString(); } }
--- a/src/org/eclipse/jetty/http/HttpGenerator.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpGenerator.java Tue Sep 13 23:13:06 2016 -0600 @@ -29,8 +29,8 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -41,7 +41,7 @@ */ public class HttpGenerator extends AbstractGenerator { - private static final Logger LOG = Log.getLogger(HttpGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpGenerator.class); // Build cache of response lines for status private static class Status @@ -140,7 +140,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } super.reset(); @@ -338,7 +338,7 @@ } catch(InterruptedException e) { - LOG.debug(e); + LOG.debug("",e); throw new InterruptedIOException(e.toString()); } } @@ -910,7 +910,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); throw (e instanceof EofException) ? e:new EofException(e); } }
--- a/src/org/eclipse/jetty/http/HttpParser.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpParser.java Tue Sep 13 23:13:06 2016 -0600 @@ -30,12 +30,12 @@ import org.eclipse.jetty.io.View; import org.eclipse.jetty.io.bio.StreamEndPoint; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HttpParser implements Parser { - private static final Logger LOG = Log.getLogger(HttpParser.class); + private static final Logger LOG = LoggerFactory.getLogger(HttpParser.class); // States public static final int STATE_START=-14; @@ -537,7 +537,7 @@ } catch(NumberFormatException e) { - LOG.ignore(e); + LOG.trace("",e); throw new HttpException(HttpStatus.BAD_REQUEST_400); } if (_contentLength <= 0) @@ -1046,7 +1046,7 @@ } catch(IOException e) { - LOG.debug(e); + LOG.debug("",e); throw (e instanceof EofException) ? e:new EofException(e); } }
--- a/src/org/eclipse/jetty/http/MimeTypes.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/http/MimeTypes.java Tue Sep 13 23:13:06 2016 -0600 @@ -29,8 +29,8 @@ import org.eclipse.jetty.io.BufferCache; import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -39,7 +39,7 @@ */ public class MimeTypes { - private static final Logger LOG = Log.getLogger(MimeTypes.class); + private static final Logger LOG = LoggerFactory.getLogger(MimeTypes.class); public final static String FORM_ENCODED="application/x-www-form-urlencoded", @@ -141,7 +141,7 @@ catch(MissingResourceException e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); } try @@ -157,7 +157,7 @@ catch(MissingResourceException e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); }
--- a/src/org/eclipse/jetty/io/AbstractBuffer.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/AbstractBuffer.java Tue Sep 13 23:13:06 2016 -0600 @@ -24,8 +24,8 @@ import java.nio.charset.Charset; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -33,7 +33,7 @@ */ public abstract class AbstractBuffer implements Buffer { - private static final Logger LOG = Log.getLogger(AbstractBuffer.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractBuffer.class); private final static boolean __boundsChecking = Boolean.getBoolean("org.eclipse.jetty.io.AbstractBuffer.boundsChecking"); @@ -640,7 +640,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); return new String(asArray(), 0, length()); } } @@ -657,7 +657,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); return new String(asArray(), 0, length()); } }
--- a/src/org/eclipse/jetty/io/AbstractConnection.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/AbstractConnection.java Tue Sep 13 23:13:06 2016 -0600 @@ -20,66 +20,66 @@ import java.io.IOException; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractConnection implements Connection { - private static final Logger LOG = Log.getLogger(AbstractConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractConnection.class); - private final long _timeStamp; - protected final EndPoint _endp; + private final long _timeStamp; + protected final EndPoint _endp; - public AbstractConnection(EndPoint endp) - { - _endp=(EndPoint)endp; - _timeStamp = System.currentTimeMillis(); - } + public AbstractConnection(EndPoint endp) + { + _endp=(EndPoint)endp; + _timeStamp = System.currentTimeMillis(); + } - public AbstractConnection(EndPoint endp,long timestamp) - { - _endp=(EndPoint)endp; - _timeStamp = timestamp; - } + public AbstractConnection(EndPoint endp,long timestamp) + { + _endp=(EndPoint)endp; + _timeStamp = timestamp; + } - public long getTimeStamp() - { - return _timeStamp; - } + public long getTimeStamp() + { + return _timeStamp; + } - public EndPoint getEndPoint() - { - return _endp; - } + public EndPoint getEndPoint() + { + return _endp; + } - public void onIdleExpired(long idleForMs) - { - try - { - LOG.debug("onIdleExpired {}ms {} {}",idleForMs,this,_endp); - if (_endp.isInputShutdown() || _endp.isOutputShutdown()) - _endp.close(); - else - _endp.shutdownOutput(); - } - catch(IOException e) - { - LOG.ignore(e); + public void onIdleExpired(long idleForMs) + { + try + { + LOG.debug("onIdleExpired {}ms {} {}",idleForMs,this,_endp); + if (_endp.isInputShutdown() || _endp.isOutputShutdown()) + _endp.close(); + else + _endp.shutdownOutput(); + } + catch(IOException e) + { + LOG.trace("",e); - try - { - _endp.close(); - } - catch(IOException e2) - { - LOG.ignore(e2); - } - } - } + try + { + _endp.close(); + } + catch(IOException e2) + { + LOG.trace("",e2); + } + } + } - public String toString() - { - return String.format("%s@%x", getClass().getSimpleName(), hashCode()); - } + public String toString() + { + return String.format("%s@%x", getClass().getSimpleName(), hashCode()); + } }
--- a/src/org/eclipse/jetty/io/UncheckedPrintWriter.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/UncheckedPrintWriter.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,8 +26,8 @@ import java.io.PrintWriter; import java.io.Writer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -37,7 +37,7 @@ */ public class UncheckedPrintWriter extends PrintWriter { - private static final Logger LOG = Log.getLogger(UncheckedPrintWriter.class); + private static final Logger LOG = LoggerFactory.getLogger(UncheckedPrintWriter.class); private boolean _autoFlush = false; private IOException _ioException; @@ -129,7 +129,7 @@ _ioException.initCause(th); } - LOG.debug(th); + LOG.debug("",th); }
--- a/src/org/eclipse/jetty/io/bio/SocketEndPoint.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/bio/SocketEndPoint.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,12 +26,12 @@ import javax.net.ssl.SSLSocket; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SocketEndPoint extends StreamEndPoint { - private static final Logger LOG = Log.getLogger(SocketEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(SocketEndPoint.class); final Socket _socket; final InetSocketAddress _local; @@ -273,7 +273,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); _socket.close(); } }
--- a/src/org/eclipse/jetty/io/nio/ChannelEndPoint.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/ChannelEndPoint.java Tue Sep 13 23:13:06 2016 -0600 @@ -31,8 +31,8 @@ import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Channel End Point. @@ -41,7 +41,7 @@ */ public class ChannelEndPoint implements EndPoint { - private static final Logger LOG = Log.getLogger(ChannelEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(ChannelEndPoint.class); protected final ByteChannel _channel; protected final ByteBuffer[] _gather2=new ByteBuffer[2]; @@ -131,7 +131,7 @@ catch (SocketException e) { LOG.debug(e.toString()); - LOG.ignore(e); + LOG.trace("",e); } finally { @@ -170,7 +170,7 @@ catch (SocketException e) { LOG.debug(e.toString()); - LOG.ignore(e); + LOG.trace("",e); } finally { @@ -259,7 +259,7 @@ } catch (Exception xx) { - LOG.ignore(xx); + LOG.trace("",xx); } if (len>0)
--- a/src/org/eclipse/jetty/io/nio/DirectNIOBuffer.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/DirectNIOBuffer.java Tue Sep 13 23:13:06 2016 -0600 @@ -32,8 +32,8 @@ import org.eclipse.jetty.io.AbstractBuffer; import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------------------------- */ /** @@ -42,7 +42,7 @@ */ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer { - private static final Logger LOG = Log.getLogger(DirectNIOBuffer.class); + private static final Logger LOG = LoggerFactory.getLogger(DirectNIOBuffer.class); protected final ByteBuffer _buf; private ReadableByteChannel _in; @@ -87,7 +87,7 @@ } finally { - if (fc != null) try {fc.close();} catch (IOException e){LOG.ignore(e);} + if (fc != null) try {fc.close();} catch (IOException e){LOG.trace("",e);} IO.close(fis); } }
--- a/src/org/eclipse/jetty/io/nio/NetworkTrafficSelectChannelEndPoint.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/NetworkTrafficSelectChannelEndPoint.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,12 +26,12 @@ import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.NetworkTrafficListener; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint { - private static final Logger LOG = Log.getLogger(NetworkTrafficSelectChannelEndPoint.class); + private static final Logger LOG = LoggerFactory.getLogger(NetworkTrafficSelectChannelEndPoint.class); private final List<NetworkTrafficListener> listeners; @@ -82,7 +82,7 @@ } catch (Exception x) { - LOG.warn(x); + LOG.warn("",x); } } } @@ -101,7 +101,7 @@ } catch (Exception x) { - LOG.warn(x); + LOG.warn("",x); } } } @@ -122,7 +122,7 @@ } catch (Exception x) { - LOG.warn(x); + LOG.warn("",x); } } } @@ -140,7 +140,7 @@ } catch (Exception x) { - LOG.warn(x); + LOG.warn("",x); } } }
--- a/src/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java Tue Sep 13 23:13:06 2016 -0600 @@ -32,8 +32,8 @@ import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.nio.SelectorManager.SelectSet; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.Timeout.Task; /* ------------------------------------------------------------ */ @@ -42,7 +42,7 @@ */ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPoint, ConnectedEndPoint { - public static final Logger LOG=Log.getLogger("org.eclipse.jetty.io.nio"); + public static final Logger LOG=LoggerFactory.getLogger("org.eclipse.jetty.io.nio"); private final boolean WORK_AROUND_JVM_BUG_6346658 = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win"); private final SelectorManager.SelectSet _selectSet; @@ -450,7 +450,7 @@ } catch (final InterruptedException e) { - LOG.warn(e); + LOG.warn("",e); if (_interruptable) throw new InterruptedIOException(){{this.initCause(e);}}; } @@ -500,7 +500,7 @@ } catch (final InterruptedException e) { - LOG.warn(e); + LOG.warn("",e); if (_interruptable) throw new InterruptedIOException(){{this.initCause(e);}}; } @@ -595,7 +595,7 @@ catch(Exception e) { _key=null; - LOG.ignore(e); + LOG.trace("",e); } } changed=_interestOps!=current_ops; @@ -636,7 +636,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); if (_key!=null && _key.isValid()) { _key.cancel(); @@ -707,25 +707,25 @@ } catch (ClosedChannelException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (EofException e) { LOG.debug("EOF", e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch (IOException e) { LOG.warn(e.toString()); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch (Throwable e) { LOG.warn("handle failed", e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } finally { @@ -740,7 +740,7 @@ { LOG.warn("onInputShutdown failed", x); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } finally { @@ -787,7 +787,7 @@ } catch (Throwable e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -797,7 +797,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } finally {
--- a/src/org/eclipse/jetty/io/nio/SelectorManager.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/SelectorManager.java Tue Sep 13 23:13:06 2016 -0600 @@ -44,8 +44,8 @@ import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.AggregateLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.Timeout; import org.eclipse.jetty.util.thread.Timeout.Task; @@ -58,7 +58,7 @@ */ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpable { - public static final Logger LOG=Log.getLogger("org.eclipse.jetty.io.nio"); + public static final Logger LOG=LoggerFactory.getLogger("org.eclipse.jetty.io.nio"); private static final int __MONITOR_PERIOD=Integer.getInteger("org.eclipse.jetty.io.nio.MONITOR_PERIOD",1000).intValue(); private static final int __MAX_SELECTS=Integer.getInteger("org.eclipse.jetty.io.nio.MAX_SELECTS",100000).intValue(); @@ -291,11 +291,11 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } } @@ -366,7 +366,7 @@ protected void connectionFailed(SocketChannel channel,Throwable ex,Object attachment) { LOG.warn(ex+","+channel+","+attachment); - LOG.debug(ex); + LOG.debug("",ex); } /* ------------------------------------------------------------ */ @@ -510,14 +510,14 @@ } catch (CancelledKeyException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (Throwable e) { if (isRunning()) - LOG.warn(e); + LOG.warn("",e); else - LOG.debug(e); + LOG.debug("",e); try { @@ -526,7 +526,7 @@ } catch(IOException e2) { - LOG.debug(e2); + LOG.debug("",e2); } } } @@ -549,7 +549,7 @@ } catch(InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } now=System.currentTimeMillis(); } @@ -660,14 +660,14 @@ } catch (CancelledKeyException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (Exception e) { if (isRunning()) - LOG.warn(e); + LOG.warn("",e); else - LOG.ignore(e); + LOG.trace("",e); try { @@ -676,7 +676,7 @@ } catch(IOException e2) { - LOG.debug(e2); + LOG.debug("",e2); } if (key != null && !(key.channel() instanceof ServerSocketChannel) && key.isValid()) @@ -732,13 +732,13 @@ catch (ClosedSelectorException e) { if (isRunning()) - LOG.warn(e); + LOG.warn("",e); else - LOG.ignore(e); + LOG.trace("",e); } catch (CancelledKeyException e) { - LOG.ignore(e); + LOG.trace("",e); } finally { @@ -875,7 +875,7 @@ } catch(Exception e) { - LOG.ignore(e); + LOG.trace("",e); } // close endpoints and selector @@ -896,7 +896,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } } @@ -911,7 +911,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } _selector=null; } @@ -965,7 +965,7 @@ } catch(InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } AggregateLifeCycle.dump(out,indent,dump);
--- a/src/org/eclipse/jetty/io/nio/SslConnection.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/SslConnection.java Tue Sep 13 23:13:06 2016 -0600 @@ -32,8 +32,8 @@ import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.Timeout.Task; /* ------------------------------------------------------------ */ @@ -47,7 +47,7 @@ */ public class SslConnection extends AbstractConnection implements AsyncConnection { - private final Logger _logger = Log.getLogger("org.eclipse.jetty.io.nio.ssl"); + private final Logger _logger = LoggerFactory.getLogger("org.eclipse.jetty.io.nio.ssl"); private static final NIOBuffer __ZERO_BUFFER=new IndirectNIOBuffer(0); @@ -219,7 +219,7 @@ _logger.warn("onInputShutdown failed", x); try{_sslEndPoint.close();} catch(IOException e2){ - _logger.ignore(e2);} + _logger.trace("",e2);} } } } @@ -261,7 +261,7 @@ } catch (IOException e) { - _logger.warn(e); + _logger.warn("",e); super.onIdleExpired(idleForMs); } } @@ -436,7 +436,7 @@ } catch (SSLException x) { - _logger.debug(x); + _logger.debug("",x); } }
--- a/src/org/eclipse/jetty/server/AbstractConnector.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/AbstractConnector.java Tue Sep 13 23:13:06 2016 -0600 @@ -38,8 +38,8 @@ import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.util.component.AggregateLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.ThreadPool; /** @@ -55,7 +55,7 @@ */ public abstract class AbstractConnector extends AggregateLifeCycle implements HttpBuffers, Connector, Dumpable { - private static final Logger LOG = Log.getLogger(AbstractConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractConnector.class); private String _name; @@ -337,7 +337,7 @@ } catch (IOException e) { - LOG.warn(e); + LOG.warn("",e); } super.doStop(); @@ -385,7 +385,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -459,7 +459,7 @@ } catch (UnknownHostException e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -928,20 +928,20 @@ } catch (EofException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (InterruptedException x) { // Connector has been stopped - LOG.ignore(x); + LOG.trace("",x); } catch (Throwable e) { - LOG.warn(e); + LOG.warn("",e); } } }
--- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java Tue Sep 13 23:13:06 2016 -0600 @@ -62,8 +62,8 @@ import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.Resource; /** @@ -99,7 +99,7 @@ */ public abstract class AbstractHttpConnection extends AbstractConnection { - private static final Logger LOG = Log.getLogger(AbstractHttpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractHttpConnection.class); private static final int UNKNOWN = -2; private static final ThreadLocal<AbstractHttpConnection> __currentConnection = new ThreadLocal<AbstractHttpConnection>(); @@ -467,7 +467,7 @@ catch (Exception e) { LOG.warn("Failed UTF-8 decode for request path, trying ISO-8859-1"); - LOG.ignore(e); + LOG.trace("",e); path = _uri.getDecodedPath(StringUtil.__ISO_8859_1); } @@ -521,12 +521,12 @@ } catch (ContinuationThrowable e) { - LOG.ignore(e); + LOG.trace("",e); } catch (EofException e) { async_exception=e; - LOG.debug(e); + LOG.debug("",e); error=true; _request.setHandled(true); if (!_response.isCommitted()) @@ -535,13 +535,13 @@ catch (RuntimeIOException e) { async_exception=e; - LOG.debug(e); + LOG.debug("",e); error=true; _request.setHandled(true); } catch (HttpException e) { - LOG.debug(e); + LOG.debug("",e); error=true; _request.setHandled(true); _response.sendError(e.getStatus(), e.getReason()); @@ -663,7 +663,7 @@ catch(RuntimeException e) { LOG.warn("header full: "+e); - LOG.debug(e); + LOG.debug("",e); _response.reset(); _generator.reset(); @@ -823,7 +823,7 @@ } catch (Exception e) { - LOG.debug(e); + LOG.debug("",e); if (e instanceof HttpException) throw (HttpException)e; throw new HttpException(HttpStatus.BAD_REQUEST_400,null,e);
--- a/src/org/eclipse/jetty/server/AsyncContinuation.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/AsyncContinuation.java Tue Sep 13 23:13:06 2016 -0600 @@ -40,8 +40,8 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandler.Context; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.Timeout; /* ------------------------------------------------------------ */ @@ -50,7 +50,7 @@ */ public class AsyncContinuation implements AsyncContext, Continuation { - private static final Logger LOG = Log.getLogger(AsyncContinuation.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncContinuation.class); private final static long DEFAULT_TIMEOUT=30000L; @@ -386,7 +386,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } } @@ -511,7 +511,7 @@ } catch(Exception e) { - LOG.debug(e); + LOG.debug("",e); _connection.getRequest().setAttribute(RequestDispatcher.ERROR_EXCEPTION,e); break; } @@ -527,7 +527,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } } @@ -671,7 +671,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } } @@ -685,7 +685,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } } @@ -754,7 +754,7 @@ } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } wait=_expireAt-System.currentTimeMillis(); }
--- a/src/org/eclipse/jetty/server/AsyncHttpConnection.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/AsyncHttpConnection.java Tue Sep 13 23:13:06 2016 -0600 @@ -27,8 +27,8 @@ import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.nio.AsyncConnection; import org.eclipse.jetty.io.nio.SelectChannelEndPoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -40,7 +40,7 @@ private final static int NO_PROGRESS_INFO = Integer.getInteger("org.mortbay.jetty.NO_PROGRESS_INFO",100); private final static int NO_PROGRESS_CLOSE = Integer.getInteger("org.mortbay.jetty.NO_PROGRESS_CLOSE",200); - private static final Logger LOG = Log.getLogger(AsyncHttpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncHttpConnection.class); private int _total_no_progress; private final AsyncEndPoint _asyncEndp; private boolean _readInterested = true; @@ -100,7 +100,7 @@ { LOG.debug("uri="+_uri); LOG.debug("fields="+_requestFields); - LOG.debug(e); + LOG.debug("",e); } progress=true; _generator.sendError(e.getStatus(), e.getReason(), null, true);
--- a/src/org/eclipse/jetty/server/AsyncNCSARequestLog.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/AsyncNCSARequestLog.java Tue Sep 13 23:13:06 2016 -0600 @@ -19,8 +19,8 @@ package org.eclipse.jetty.server; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.concurrent.BlockingQueue; @@ -34,7 +34,7 @@ */ public class AsyncNCSARequestLog extends NCSARequestLog { - private static final Logger LOG = Log.getLogger(AsyncNCSARequestLog.class); + private static final Logger LOG = LoggerFactory.getLogger(AsyncNCSARequestLog.class); private final BlockingQueue<String> _queue; private transient WriterThread _thread; private boolean _warnedFull; @@ -89,11 +89,11 @@ } catch (IOException e) { - LOG.warn(e); + LOG.warn("",e); } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } } }
--- a/src/org/eclipse/jetty/server/BlockingHttpConnection.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/BlockingHttpConnection.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,8 +26,8 @@ import org.eclipse.jetty.http.Parser; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -35,7 +35,7 @@ */ public class BlockingHttpConnection extends AbstractHttpConnection { - private static final Logger LOG = Log.getLogger(BlockingHttpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(BlockingHttpConnection.class); public BlockingHttpConnection(Connector connector, EndPoint endpoint, Server server) { @@ -87,7 +87,7 @@ { LOG.debug("uri="+_uri); LOG.debug("fields="+_requestFields); - LOG.debug(e); + LOG.debug("",e); } _generator.sendError(e.getStatus(), e.getReason(), null, true); _parser.reset();
--- a/src/org/eclipse/jetty/server/CookieCutter.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/CookieCutter.java Tue Sep 13 23:13:06 2016 -0600 @@ -23,8 +23,8 @@ import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.QuotedStringTokenizer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -39,7 +39,7 @@ */ public class CookieCutter { - private static final Logger LOG = Log.getLogger(CookieCutter.class); + private static final Logger LOG = LoggerFactory.getLogger(CookieCutter.class); private Cookie[] _cookies; @@ -319,7 +319,7 @@ } catch (Exception e) { - LOG.debug(e); + LOG.debug("",e); } name = null;
--- a/src/org/eclipse/jetty/server/InclusiveByteRange.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/InclusiveByteRange.java Tue Sep 13 23:13:06 2016 -0600 @@ -23,8 +23,8 @@ import java.util.StringTokenizer; import org.eclipse.jetty.util.LazyList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** Byte range inclusive of end points. @@ -49,7 +49,7 @@ */ public class InclusiveByteRange { - private static final Logger LOG = Log.getLogger(InclusiveByteRange.class); + private static final Logger LOG = LoggerFactory.getLogger(InclusiveByteRange.class); long first = 0; long last = 0; @@ -141,7 +141,7 @@ catch (NumberFormatException e) { LOG.warn("Bad range format: {}",t); - LOG.ignore(e); + LOG.trace("",e); continue; } } @@ -149,7 +149,7 @@ catch(Exception e) { LOG.warn("Bad range format: {}",t); - LOG.ignore(e); + LOG.trace("",e); } } return LazyList.getList(satRanges,true);
--- a/src/org/eclipse/jetty/server/LocalConnector.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/LocalConnector.java Tue Sep 13 23:13:06 2016 -0600 @@ -28,12 +28,12 @@ import org.eclipse.jetty.io.ByteArrayEndPoint; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class LocalConnector extends AbstractConnector { - private static final Logger LOG = Log.getLogger(LocalConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(LocalConnector.class); private final BlockingQueue<Request> _requests = new LinkedBlockingQueue<Request>(); public LocalConnector() @@ -146,12 +146,12 @@ } catch (IOException x) { - LOG.debug(x); + LOG.debug("",x); leaveOpen = false; } catch (Exception x) { - LOG.warn(x); + LOG.warn("",x); leaveOpen = false; } finally
--- a/src/org/eclipse/jetty/server/NCSARequestLog.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/NCSARequestLog.java Tue Sep 13 23:13:06 2016 -0600 @@ -33,8 +33,8 @@ import org.eclipse.jetty.util.RolloverFileOutputStream; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This {@link RequestLog} implementation outputs logs in the pseudo-standard @@ -52,7 +52,7 @@ */ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog { - private static final Logger LOG = Log.getLogger(NCSARequestLog.class); + private static final Logger LOG = LoggerFactory.getLogger(NCSARequestLog.class); private static ThreadLocal<StringBuilder> _buffers = new ThreadLocal<StringBuilder>() { @Override @@ -587,7 +587,7 @@ } catch (IOException e) { - LOG.warn(e); + LOG.warn("",e); } } @@ -699,7 +699,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } if (_out != null && _closeOut) try @@ -708,7 +708,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } _out = null;
--- a/src/org/eclipse/jetty/server/Request.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/Request.java Tue Sep 13 23:13:06 2016 -0600 @@ -90,8 +90,8 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.UrlEncoded; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -127,7 +127,7 @@ public static final String __MULTIPART_CONFIG_ELEMENT = "org.eclipse.multipartConfig"; public static final String __MULTIPART_INPUT_STREAM = "org.eclipse.multiPartInputStream"; public static final String __MULTIPART_CONTEXT = "org.eclipse.multiPartContext"; - private static final Logger LOG = Log.getLogger(Request.class); + private static final Logger LOG = LoggerFactory.getLogger(Request.class); private static final String __ASYNC_FWD = "org.eclipse.asyncfwd"; private static final Collection __defaultLocale = Collections.singleton(Locale.getDefault()); @@ -274,7 +274,7 @@ catch (UnsupportedEncodingException e) { if (LOG.isDebugEnabled()) - LOG.warn(e); + LOG.warn("",e); else LOG.warn(e.toString()); } @@ -349,7 +349,7 @@ catch (IOException e) { if (LOG.isDebugEnabled()) - LOG.warn(e); + LOG.warn("",e); else LOG.warn(e.toString()); } @@ -383,14 +383,14 @@ catch (IOException e) { if (LOG.isDebugEnabled()) - LOG.warn(e); + LOG.warn("",e); else LOG.warn(e.toString()); } catch (ServletException e) { if (LOG.isDebugEnabled()) - LOG.warn(e); + LOG.warn("",e); else LOG.warn(e.toString()); } @@ -1146,7 +1146,7 @@ } catch (java.net.UnknownHostException e) { - LOG.ignore(e); + LOG.trace("",e); } return _serverName; } @@ -1365,7 +1365,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); _reader = null; } }
--- a/src/org/eclipse/jetty/server/Response.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/Response.java Tue Sep 13 23:13:06 2016 -0600 @@ -51,8 +51,8 @@ import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** Response. * <p> @@ -61,7 +61,7 @@ */ public class Response implements HttpServletResponse { - private static final Logger LOG = Log.getLogger(Response.class); + private static final Logger LOG = LoggerFactory.getLogger(Response.class); public static final int
--- a/src/org/eclipse/jetty/server/Server.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/Server.java Tue Sep 13 23:13:06 2016 -0600 @@ -40,8 +40,8 @@ import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ShutdownThread; import org.eclipse.jetty.util.thread.ThreadPool; @@ -57,7 +57,7 @@ */ public class Server extends HandlerWrapper implements Attributes { - private static final Logger LOG = Log.getLogger(Server.class); + private static final Logger LOG = LoggerFactory.getLogger(Server.class); private static final String __version; static
--- a/src/org/eclipse/jetty/server/bio/SocketConnector.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/bio/SocketConnector.java Tue Sep 13 23:13:06 2016 -0600 @@ -38,8 +38,8 @@ import org.eclipse.jetty.server.BlockingHttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.component.AggregateLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------------------------- */ @@ -56,7 +56,7 @@ */ public class SocketConnector extends AbstractConnector { - private static final Logger LOG = Log.getLogger(SocketConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(SocketConnector.class); protected ServerSocket _serverSocket; protected final Set<EndPoint> _connections; @@ -268,25 +268,25 @@ { LOG.debug("EOF", e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch (SocketException e) { LOG.debug("EOF", e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch (HttpException e) { LOG.debug("BAD", e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch(Exception e) { LOG.warn("handle failed?",e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } finally { @@ -317,7 +317,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } }
--- a/src/org/eclipse/jetty/server/handler/AbstractHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/AbstractHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -24,8 +24,8 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.component.AggregateLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -35,7 +35,7 @@ */ public abstract class AbstractHandler extends AggregateLifeCycle implements Handler { - private static final Logger LOG = Log.getLogger(AbstractHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractHandler.class); private Server _server;
--- a/src/org/eclipse/jetty/server/handler/ConnectHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ConnectHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -52,8 +52,8 @@ import org.eclipse.jetty.util.HostMap; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.ThreadPool; /** @@ -63,7 +63,7 @@ */ public class ConnectHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(ConnectHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ConnectHandler.class); private final SelectorManager _selectorManager = new Manager(); private volatile int _connectTimeout = 5000; private volatile int _writeTimeout = 30000; @@ -199,7 +199,7 @@ catch(Exception e) { LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e); - LOG.debug(e); + LOG.debug("",e); } } else @@ -394,7 +394,7 @@ } catch (IOException xx) { - LOG.ignore(xx); + LOG.trace("",xx); } throw x; } @@ -576,7 +576,7 @@ } catch (ClosedChannelException x) { - LOG.debug(x); + LOG.debug("",x); throw x; } catch (IOException x) @@ -729,7 +729,7 @@ } catch(Exception e) { - LOG.debug(e); + LOG.debug("",e); close(); } } @@ -801,7 +801,7 @@ } catch (ClosedChannelException x) { - LOG.debug(x); + LOG.debug("",x); closeServer(); throw x; } @@ -899,7 +899,7 @@ } catch(Exception e) { - LOG.debug(e); + LOG.debug("",e); close(); } }
--- a/src/org/eclipse/jetty/server/handler/ContextHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ContextHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -79,8 +79,8 @@ import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.component.AggregateLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.Resource; /* ------------------------------------------------------------ */ @@ -100,7 +100,7 @@ */ public class ContextHandler extends ScopedHandler implements Attributes, Server.Graceful { - private static final Logger LOG = Log.getLogger(ContextHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ContextHandler.class); private static final ThreadLocal<Context> __context = new ThreadLocal<Context>(); @@ -475,7 +475,7 @@ } catch (IOException e) { - LOG.debug(e); + LOG.debug("",e); } } if (classpath.length() == 0) @@ -692,7 +692,7 @@ if (_contextPath == null) throw new IllegalStateException("Null contextPath"); - _logger = Log.getLogger(getDisplayName() == null?getContextPath():getDisplayName()); + _logger = LoggerFactory.getLogger(getDisplayName() == null?getContextPath():getDisplayName()); ClassLoader old_classloader = null; Thread current_thread = null; Context old_context = null; @@ -1090,7 +1090,7 @@ } catch (HttpException e) { - LOG.debug(e); + LOG.debug("",e); baseRequest.setHandled(true); response.sendError(e.getStatus(),e.getReason()); } @@ -1349,7 +1349,7 @@ catch (Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); throw new IllegalArgumentException(resourceBase); } } @@ -1586,7 +1586,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); } return null; @@ -1668,7 +1668,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); } return Collections.emptySet(); } @@ -1896,7 +1896,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); } return null; } @@ -1927,7 +1927,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); } return null; @@ -1960,7 +1960,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); return null; } }
--- a/src/org/eclipse/jetty/server/handler/ContextHandlerCollection.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ContextHandlerCollection.java Tue Sep 13 23:13:06 2016 -0600 @@ -32,8 +32,8 @@ import org.eclipse.jetty.server.HandlerContainer; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.LazyList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** ContextHandlerCollection. @@ -49,7 +49,7 @@ */ public class ContextHandlerCollection extends HandlerCollection { - private static final Logger LOG = Log.getLogger(ContextHandlerCollection.class); + private static final Logger LOG = LoggerFactory.getLogger(ContextHandlerCollection.class); private volatile PathMap _contextMap; private Class<? extends ContextHandler> _contextClass = ContextHandler.class; @@ -289,7 +289,7 @@ } catch (Exception e) { - LOG.debug(e); + LOG.debug("",e); throw new Error(e); } }
--- a/src/org/eclipse/jetty/server/handler/DefaultHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/DefaultHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -34,8 +34,8 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.ByteArrayISO8859Writer; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.Resource; @@ -53,7 +53,7 @@ */ public class DefaultHandler extends AbstractHandler { - private static final Logger LOG = Log.getLogger(DefaultHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultHandler.class); boolean _showContexts=true;
--- a/src/org/eclipse/jetty/server/handler/ErrorHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ErrorHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -35,8 +35,8 @@ import org.eclipse.jetty.server.Dispatcher; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.ByteArrayISO8859Writer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** Handler for Error pages @@ -47,7 +47,7 @@ */ public class ErrorHandler extends AbstractHandler { - private static final Logger LOG = Log.getLogger(ErrorHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ErrorHandler.class); public final static String ERROR_PAGE="org.eclipse.jetty.server.error_page"; boolean _showStacks=true; @@ -90,7 +90,7 @@ } catch (ServletException e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("EXCEPTION", e); return; } }
--- a/src/org/eclipse/jetty/server/handler/GzipHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/GzipHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -40,8 +40,8 @@ import org.eclipse.jetty.http.gzip.CompressedResponseWrapper; import org.eclipse.jetty.http.gzip.AbstractCompressedStream; import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -62,7 +62,7 @@ */ public class GzipHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(GzipHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(GzipHandler.class); protected Set<String> _mimeTypes; protected Set<String> _excluded; @@ -279,7 +279,7 @@ } catch(IOException e) { - LOG.warn(e); + LOG.warn("",e); } }
--- a/src/org/eclipse/jetty/server/handler/IPAccessHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/IPAccessHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -33,8 +33,8 @@ import org.eclipse.jetty.server.AbstractHttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.IPAddressMap; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -99,7 +99,7 @@ */ public class IPAccessHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(IPAccessHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(IPAccessHandler.class); IPAddressMap<PathMap> _white = new IPAddressMap<PathMap>(); IPAddressMap<PathMap> _black = new IPAddressMap<PathMap>();
--- a/src/org/eclipse/jetty/server/handler/RequestLogHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/RequestLogHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -33,8 +33,8 @@ import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -45,7 +45,7 @@ */ public class RequestLogHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(RequestLogHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(RequestLogHandler.class); private RequestLog _requestLog; @@ -105,7 +105,7 @@ } catch (Exception e) { - LOG.warn (e); + LOG.warn ("",e); } if (getServer()!=null)
--- a/src/org/eclipse/jetty/server/handler/ResourceHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ResourceHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -40,8 +40,8 @@ import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.handler.ContextHandler.Context; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.FileResource; import org.eclipse.jetty.util.resource.Resource; @@ -58,7 +58,7 @@ */ public class ResourceHandler extends HandlerWrapper { - private static final Logger LOG = Log.getLogger(ResourceHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); ContextHandler _context; Resource _baseResource; @@ -209,7 +209,7 @@ catch (Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); throw new IllegalArgumentException(resourceBase); } } @@ -235,7 +235,7 @@ catch(IOException e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); } } return _defaultStylesheet; @@ -260,7 +260,7 @@ catch(Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); throw new IllegalArgumentException(stylesheet.toString()); } } @@ -308,7 +308,7 @@ } catch(Exception e) { - LOG.ignore(e); + LOG.trace("",e); } return null;
--- a/src/org/eclipse/jetty/server/handler/ShutdownHandler.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/handler/ShutdownHandler.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,8 +26,8 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -66,7 +66,7 @@ */ public class ShutdownHandler extends AbstractHandler { - private static final Logger LOG = Log.getLogger(ShutdownHandler.class); + private static final Logger LOG = LoggerFactory.getLogger(ShutdownHandler.class); private final String _shutdownToken; @@ -127,7 +127,7 @@ } catch (InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (Exception e) {
--- a/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Tue Sep 13 23:13:06 2016 -0600 @@ -37,8 +37,8 @@ import org.eclipse.jetty.server.BlockingHttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.ConcurrentHashSet; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------------------------- */ @@ -55,7 +55,7 @@ */ public class BlockingChannelConnector extends AbstractNIOConnector { - private static final Logger LOG = Log.getLogger(BlockingChannelConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(BlockingChannelConnector.class); private transient ServerSocketChannel _acceptChannel; private final Set<BlockingChannelEndPoint> _endpoints = new ConcurrentHashSet<BlockingChannelEndPoint>(); @@ -101,11 +101,11 @@ } catch(InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } } @@ -217,7 +217,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -303,19 +303,19 @@ { LOG.debug("EOF", e); try{BlockingChannelEndPoint.this.close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch (HttpException e) { LOG.debug("BAD", e); try{super.close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch(Throwable e) { LOG.warn("handle failed",e); try{super.close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } finally { @@ -343,7 +343,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } }
--- a/src/org/eclipse/jetty/server/nio/InheritedChannelConnector.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/nio/InheritedChannelConnector.java Tue Sep 13 23:13:06 2016 -0600 @@ -22,8 +22,8 @@ import java.nio.channels.Channel; import java.nio.channels.ServerSocketChannel; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An implementation of the SelectChannelConnector which first tries to @@ -43,7 +43,7 @@ */ public class InheritedChannelConnector extends SelectChannelConnector { - private static final Logger LOG = Log.getLogger(InheritedChannelConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(InheritedChannelConnector.class); /* ------------------------------------------------------------ */ @Override
--- a/src/org/eclipse/jetty/server/ssl/SslCertificates.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/ssl/SslCertificates.java Tue Sep 13 23:13:06 2016 -0600 @@ -31,12 +31,12 @@ import org.eclipse.jetty.io.bio.SocketEndPoint; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SslCertificates { - private static final Logger LOG = Log.getLogger(SslCertificates.class); + private static final Logger LOG = LoggerFactory.getLogger(SslCertificates.class); /** * The name of the SSLSession attribute that will contain any cached information. @@ -70,7 +70,7 @@ } catch (Exception e) { - LOG.warn(Log.EXCEPTION,e); + LOG.warn("EXCEPTION",e); return null; } } @@ -139,7 +139,7 @@ } catch (Exception e) { - LOG.warn(Log.EXCEPTION,e); + LOG.warn("EXCEPTION",e); } }
--- a/src/org/eclipse/jetty/server/ssl/SslSocketConnector.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/server/ssl/SslSocketConnector.java Tue Sep 13 23:13:06 2016 -0600 @@ -36,8 +36,8 @@ import org.eclipse.jetty.io.bio.SocketEndPoint; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.bio.SocketConnector; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.ssl.SslContextFactory; /* ------------------------------------------------------------ */ @@ -57,7 +57,7 @@ */ public class SslSocketConnector extends SocketConnector implements SslConnector { - private static final Logger LOG = Log.getLogger(SslSocketConnector.class); + private static final Logger LOG = LoggerFactory.getLogger(SslSocketConnector.class); private final SslContextFactory _sslContextFactory; private int _handshakeTimeout = 0; //0 means use maxIdleTime @@ -655,7 +655,7 @@ if (!_sslContextFactory.isAllowRenegotiate()) { LOG.warn("SSL renegotiate denied: "+ssl); - try{ssl.close();}catch(IOException e){LOG.warn(e);} + try{ssl.close();}catch(IOException e){LOG.warn("",e);} } } else @@ -671,15 +671,15 @@ } catch (SSLException e) { - LOG.debug(e); + LOG.debug("",e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } catch (IOException e) { - LOG.debug(e); + LOG.debug("",e); try{close();} - catch(IOException e2){LOG.ignore(e2);} + catch(IOException e2){LOG.trace("",e2);} } } }
--- a/src/org/eclipse/jetty/util/IO.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/IO.java Tue Sep 13 23:13:06 2016 -0600 @@ -31,8 +31,8 @@ import java.io.StringWriter; import java.io.Writer; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; /* ======================================================================== */ @@ -42,7 +42,7 @@ */ public class IO { - private static final Logger LOG = Log.getLogger(IO.class); + private static final Logger LOG = LoggerFactory.getLogger(IO.class); /* ------------------------------------------------------------------- */ public final static String @@ -62,7 +62,7 @@ static { try{__pool.start();} - catch(Exception e){LOG.warn(e); System.exit(1);} + catch(Exception e){LOG.warn("",e); System.exit(1);} } } @@ -103,7 +103,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); try{ if (out!=null) out.close(); @@ -112,7 +112,7 @@ } catch(IOException e2) { - LOG.ignore(e2); + LOG.trace("",e2); } } } @@ -131,7 +131,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } @@ -158,7 +158,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } } @@ -373,7 +373,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -391,7 +391,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -408,7 +408,7 @@ reader.close(); } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -425,7 +425,7 @@ writer.close(); } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -453,7 +453,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } }
--- a/src/org/eclipse/jetty/util/MultiPartInputStream.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/MultiPartInputStream.java Tue Sep 13 23:13:06 2016 -0600 @@ -46,8 +46,8 @@ import javax.servlet.ServletException; import javax.servlet.http.Part; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @@ -58,7 +58,7 @@ */ public class MultiPartInputStream { - private static final Logger LOG = Log.getLogger(MultiPartInputStream.class); + private static final Logger LOG = LoggerFactory.getLogger(MultiPartInputStream.class); public static final MultipartConfigElement __DEFAULT_MULTIPART_CONFIG = new MultipartConfigElement(System.getProperty("java.io.tmpdir")); protected InputStream _in;
--- a/src/org/eclipse/jetty/util/Scanner.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/Scanner.java Tue Sep 13 23:13:06 2016 -0600 @@ -35,8 +35,8 @@ import java.util.TimerTask; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -48,7 +48,7 @@ */ public class Scanner extends AbstractLifeCycle { - private static final Logger LOG = Log.getLogger(Scanner.class); + private static final Logger LOG = LoggerFactory.getLogger(Scanner.class); private static int __scannerId=0; private int _scanInterval; private int _scanCount = 0; @@ -414,11 +414,11 @@ } catch (Exception e) { - LOG.warn(e); + LOG.warn("",e); } catch (Error e) { - LOG.warn(e); + LOG.warn("",e); } } }
--- a/src/org/eclipse/jetty/util/StringUtil.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/StringUtil.java Tue Sep 13 23:13:06 2016 -0600 @@ -21,8 +21,8 @@ import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** Fast String Utilities. * @@ -35,7 +35,7 @@ */ public class StringUtil { - private static final Logger LOG = Log.getLogger(StringUtil.class); + private static final Logger LOG = LoggerFactory.getLogger(StringUtil.class); public static final String ALL_INTERFACES="0.0.0.0"; public static final String CRLF="\015\012"; @@ -379,7 +379,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); return s.getBytes(); } } @@ -392,7 +392,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); return s.getBytes(); } }
--- a/src/org/eclipse/jetty/util/TypeUtil.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/TypeUtil.java Tue Sep 13 23:13:06 2016 -0600 @@ -30,8 +30,8 @@ import java.util.HashMap; import java.util.List; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -44,7 +44,7 @@ */ public class TypeUtil { - private static final Logger LOG = Log.getLogger(TypeUtil.class); + private static final Logger LOG = LoggerFactory.getLogger(TypeUtil.class); public static int CR = '\015'; public static int LF = '\012'; @@ -553,7 +553,7 @@ } catch(Exception e) { - LOG.ignore(e); + LOG.trace("",e); } return null; } @@ -580,11 +580,11 @@ } catch (IllegalAccessException e) { - LOG.ignore(e); + LOG.trace("",e); } catch (IllegalArgumentException e) { - LOG.ignore(e); + LOG.trace("",e); } }
--- a/src/org/eclipse/jetty/util/URIUtil.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/URIUtil.java Tue Sep 13 23:13:06 2016 -0600 @@ -22,8 +22,6 @@ import java.net.URI; import java.net.URLEncoder; -import org.eclipse.jetty.util.log.Log; - /* ------------------------------------------------------------ */
--- a/src/org/eclipse/jetty/util/UrlEncoded.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/UrlEncoded.java Tue Sep 13 23:13:06 2016 -0600 @@ -29,8 +29,8 @@ import java.util.Map; import org.eclipse.jetty.util.Utf8Appendable.NotUtf8Exception; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** Handles coding of MIME "x-www-form-urlencoded". @@ -53,7 +53,7 @@ */ public class UrlEncoded extends MultiMap implements Cloneable { - private static final Logger LOG = Log.getLogger(UrlEncoded.class); + private static final Logger LOG = LoggerFactory.getLogger(UrlEncoded.class); public static final String ENCODING = System.getProperty("org.eclipse.jetty.util.UrlEncoding.charset",StringUtil.__UTF8); @@ -360,7 +360,7 @@ catch(NotUtf8Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); } } @@ -564,7 +564,7 @@ catch(NotUtf8Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); } if (maxLength>=0 && (++totalLength > maxLength)) throw new IllegalStateException("Form too large"); @@ -789,11 +789,11 @@ catch(NotUtf8Exception e) { LOG.warn(e.toString()); - LOG.debug(e); + LOG.debug("",e); } catch(NumberFormatException nfe) { - LOG.debug(nfe); + LOG.debug("",nfe); buffer.getStringBuffer().append(Utf8Appendable.REPLACEMENT); } } @@ -890,7 +890,7 @@ } catch(NumberFormatException nfe) { - LOG.ignore(nfe); + LOG.trace("",nfe); ba[n++] = (byte)'?'; } }
--- a/src/org/eclipse/jetty/util/Utf8Appendable.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/Utf8Appendable.java Tue Sep 13 23:13:06 2016 -0600 @@ -20,8 +20,8 @@ import java.io.IOException; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -49,7 +49,7 @@ **/ public abstract class Utf8Appendable { - protected static final Logger LOG = Log.getLogger(Utf8Appendable.class); + protected static final Logger LOG = LoggerFactory.getLogger(Utf8Appendable.class); public static final char REPLACEMENT = '\ufffd'; private static final int UTF8_ACCEPT = 0; private static final int UTF8_REJECT = 12; @@ -231,7 +231,7 @@ } Throwable th= new NotUtf8Exception("incomplete UTF8 sequence"); LOG.warn(th.toString()); - LOG.debug(th); + LOG.debug("",th); } return _appendable.toString(); }
--- a/src/org/eclipse/jetty/util/component/AbstractLifeCycle.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/component/AbstractLifeCycle.java Tue Sep 13 23:13:06 2016 -0600 @@ -20,8 +20,8 @@ import java.util.concurrent.CopyOnWriteArrayList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Basic implementation of the life cycle interface for components. @@ -30,7 +30,7 @@ */ public abstract class AbstractLifeCycle implements LifeCycle { - private static final Logger LOG = Log.getLogger(AbstractLifeCycle.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractLifeCycle.class); public static final String STOPPED="STOPPED"; public static final String FAILED="FAILED"; public static final String STARTING="STARTING";
--- a/src/org/eclipse/jetty/util/component/AggregateLifeCycle.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/component/AggregateLifeCycle.java Tue Sep 13 23:13:06 2016 -0600 @@ -26,8 +26,8 @@ import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * An AggregateLifeCycle is an {@link LifeCycle} implementation for a collection of contained beans. @@ -45,7 +45,7 @@ */ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable, Dumpable { - private static final Logger LOG = Log.getLogger(AggregateLifeCycle.class); + private static final Logger LOG = LoggerFactory.getLogger(AggregateLifeCycle.class); private final List<Bean> _beans=new CopyOnWriteArrayList<Bean>(); private boolean _started=false; @@ -328,7 +328,7 @@ } catch (IOException e) { - LOG.warn(e); + LOG.warn("",e); } } @@ -348,7 +348,7 @@ } catch (IOException e) { - LOG.warn(e); + LOG.warn("",e); } return b.toString(); }
--- a/src/org/eclipse/jetty/util/component/Container.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/component/Container.java Tue Sep 13 23:13:06 2016 -0600 @@ -22,8 +22,8 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.jetty.util.LazyList; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** Container. @@ -45,7 +45,7 @@ */ public class Container { - private static final Logger LOG = Log.getLogger(Container.class); + private static final Logger LOG = LoggerFactory.getLogger(Container.class); private final CopyOnWriteArrayList<Container.Listener> _listeners=new CopyOnWriteArrayList<Container.Listener>(); public void addEventListener(Container.Listener listener)
--- a/src/org/eclipse/jetty/util/component/FileDestroyable.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/component/FileDestroyable.java Tue Sep 13 23:13:06 2016 -0600 @@ -25,13 +25,13 @@ import java.util.List; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.Resource; public class FileDestroyable implements Destroyable { - private static final Logger LOG = Log.getLogger(FileDestroyable.class); + private static final Logger LOG = LoggerFactory.getLogger(FileDestroyable.class); final List<File> _files = new ArrayList<File>(); public FileDestroyable()
--- a/src/org/eclipse/jetty/util/component/FileNoticeLifeCycleListener.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/component/FileNoticeLifeCycleListener.java Tue Sep 13 23:13:06 2016 -0600 @@ -20,8 +20,8 @@ import java.io.FileWriter; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -30,7 +30,7 @@ */ public class FileNoticeLifeCycleListener implements LifeCycle.Listener { - Logger LOG = Log.getLogger(FileNoticeLifeCycleListener.class); + Logger LOG = LoggerFactory.getLogger(FileNoticeLifeCycleListener.class); private final String _filename; @@ -49,7 +49,7 @@ } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } }
--- a/src/org/eclipse/jetty/util/log/AbstractLogger.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - - -/* ------------------------------------------------------------ */ -/** Abstract Logger. - * Manages the atomic registration of the logger by name. - */ -public abstract class AbstractLogger implements Logger -{ - public final Logger getLogger(String name) - { - if (isBlank(name)) - return this; - - final String basename = getName(); - final String fullname = (isBlank(basename) || Log.getRootLogger()==this)?name:(basename + "." + name); - - Logger logger = Log.getLoggers().get(fullname); - if (logger == null) - { - Logger newlog = newLogger(fullname); - - logger = Log.getMutableLoggers().putIfAbsent(fullname,newlog); - if (logger == null) - logger=newlog; - } - - return logger; - } - - - protected abstract Logger newLogger(String fullname); - - /** - * A more robust form of name blank test. Will return true for null names, and names that have only whitespace - * - * @param name - * the name to test - * @return true for null or blank name, false if any non-whitespace character is found. - */ - private static boolean isBlank(String name) - { - if (name == null) - { - return true; - } - int size = name.length(); - char c; - for (int i = 0; i < size; i++) - { - c = name.charAt(i); - if (!Character.isWhitespace(c)) - { - return false; - } - } - return true; - } -}
--- a/src/org/eclipse/jetty/util/log/JavaUtilLog.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.util.logging.Level; - -/** - * <p> - * Implementation of Jetty {@link Logger} based on {@link java.util.logging.Logger}. - * </p> - * - * <p> - * You can also set the logger level using <a href="http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html"> - * standard java.util.logging configuration</a>. - * </p> - */ -public class JavaUtilLog extends AbstractLogger -{ - private Level configuredLevel; - private java.util.logging.Logger _logger; - - public JavaUtilLog() - { - this("org.eclipse.jetty.util.log"); - } - - public JavaUtilLog(String name) - { - _logger = java.util.logging.Logger.getLogger(name); - if (Boolean.parseBoolean(Log.__props.getProperty("org.eclipse.jetty.util.log.DEBUG", "false"))) - { - _logger.setLevel(Level.FINE); - } - configuredLevel = _logger.getLevel(); - } - - public String getName() - { - return _logger.getName(); - } - - public void warn(String msg, Object... args) - { - _logger.log(Level.WARNING, format(msg, args)); - } - - public void warn(Throwable thrown) - { - warn("", thrown); - } - - public void warn(String msg, Throwable thrown) - { - _logger.log(Level.WARNING, msg, thrown); - } - - public void info(String msg, Object... args) - { - _logger.log(Level.INFO, format(msg, args)); - } - - public void info(Throwable thrown) - { - info("", thrown); - } - - public void info(String msg, Throwable thrown) - { - _logger.log(Level.INFO, msg, thrown); - } - - public boolean isDebugEnabled() - { - return _logger.isLoggable(Level.FINE); - } - - public void setDebugEnabled(boolean enabled) - { - if (enabled) - { - configuredLevel = _logger.getLevel(); - _logger.setLevel(Level.FINE); - } - else - { - _logger.setLevel(configuredLevel); - } - } - - public void debug(String msg, Object... args) - { - _logger.log(Level.FINE, format(msg, args)); - } - - public void debug(Throwable thrown) - { - debug("", thrown); - } - - public void debug(String msg, Throwable thrown) - { - _logger.log(Level.FINE, msg, thrown); - } - - /** - * Create a Child Logger of this Logger. - */ - protected Logger newLogger(String fullname) - { - return new JavaUtilLog(fullname); - } - - public void ignore(Throwable ignored) - { - if (Log.isIgnored()) - { - warn(Log.IGNORED, ignored); - } - } - - private String format(String msg, Object... args) - { - msg = String.valueOf(msg); // Avoids NPE - String braces = "{}"; - StringBuilder builder = new StringBuilder(); - int start = 0; - for (Object arg : args) - { - int bracesIndex = msg.indexOf(braces, start); - if (bracesIndex < 0) - { - builder.append(msg.substring(start)); - builder.append(" "); - builder.append(arg); - start = msg.length(); - } - else - { - builder.append(msg.substring(start, bracesIndex)); - builder.append(String.valueOf(arg)); - start = bracesIndex + braces.length(); - } - } - builder.append(msg.substring(start)); - return builder.toString(); - } -}
--- a/src/org/eclipse/jetty/util/log/JettyAwareLogger.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,624 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import org.slf4j.Marker; -import org.slf4j.helpers.FormattingTuple; -import org.slf4j.helpers.MessageFormatter; - -/** - * JettyAwareLogger is used to fix a FQCN bug that arises from how Jetty - * Log uses an indirect slf4j implementation. - * - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=276670 - */ -class JettyAwareLogger implements org.slf4j.Logger -{ - private static final int DEBUG = org.slf4j.spi.LocationAwareLogger.DEBUG_INT; - private static final int ERROR = org.slf4j.spi.LocationAwareLogger.ERROR_INT; - private static final int INFO = org.slf4j.spi.LocationAwareLogger.INFO_INT; - private static final int TRACE = org.slf4j.spi.LocationAwareLogger.TRACE_INT; - private static final int WARN = org.slf4j.spi.LocationAwareLogger.WARN_INT; - - private static final String FQCN = Slf4jLog.class.getName(); - private final org.slf4j.spi.LocationAwareLogger _logger; - - public JettyAwareLogger(org.slf4j.spi.LocationAwareLogger logger) - { - _logger = logger; - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#getName() - */ - public String getName() - { - return _logger.getName(); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isTraceEnabled() - */ - public boolean isTraceEnabled() - { - return _logger.isTraceEnabled(); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(java.lang.String) - */ - public void trace(String msg) - { - log(null, TRACE, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object) - */ - public void trace(String format, Object arg) - { - log(null, TRACE, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object, java.lang.Object) - */ - public void trace(String format, Object arg1, Object arg2) - { - log(null, TRACE, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Object[]) - */ - public void trace(String format, Object[] argArray) - { - log(null, TRACE, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(java.lang.String, java.lang.Throwable) - */ - public void trace(String msg, Throwable t) - { - log(null, TRACE, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isTraceEnabled(org.slf4j.Marker) - */ - public boolean isTraceEnabled(Marker marker) - { - return _logger.isTraceEnabled(marker); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String) - */ - public void trace(Marker marker, String msg) - { - log(marker, TRACE, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Object) - */ - public void trace(Marker marker, String format, Object arg) - { - log(marker, TRACE, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object) - */ - public void trace(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, TRACE, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Object[]) - */ - public void trace(Marker marker, String format, Object[] argArray) - { - log(marker, TRACE, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#trace(org.slf4j.Marker, java.lang.String, java.lang.Throwable) - */ - public void trace(Marker marker, String msg, Throwable t) - { - log(marker, TRACE, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isDebugEnabled() - */ - public boolean isDebugEnabled() - { - return _logger.isDebugEnabled(); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(java.lang.String) - */ - public void debug(String msg) - { - log(null, DEBUG, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object) - */ - public void debug(String format, Object arg) - { - log(null, DEBUG, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object, java.lang.Object) - */ - public void debug(String format, Object arg1, Object arg2) - { - log(null, DEBUG, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Object[]) - */ - public void debug(String format, Object[] argArray) - { - log(null, DEBUG, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(java.lang.String, java.lang.Throwable) - */ - public void debug(String msg, Throwable t) - { - log(null, DEBUG, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isDebugEnabled(org.slf4j.Marker) - */ - public boolean isDebugEnabled(Marker marker) - { - return _logger.isDebugEnabled(marker); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String) - */ - public void debug(Marker marker, String msg) - { - log(marker, DEBUG, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object) - */ - public void debug(Marker marker, String format, Object arg) - { - log(marker, DEBUG, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object) - */ - public void debug(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, DEBUG, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object[]) - */ - public void debug(Marker marker, String format, Object[] argArray) - { - log(marker, DEBUG, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Throwable) - */ - public void debug(Marker marker, String msg, Throwable t) - { - log(marker, DEBUG, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isInfoEnabled() - */ - public boolean isInfoEnabled() - { - return _logger.isInfoEnabled(); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(java.lang.String) - */ - public void info(String msg) - { - log(null, INFO, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(java.lang.String, java.lang.Object) - */ - public void info(String format, Object arg) - { - log(null, INFO, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(java.lang.String, java.lang.Object, java.lang.Object) - */ - public void info(String format, Object arg1, Object arg2) - { - log(null, INFO, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(java.lang.String, java.lang.Object[]) - */ - public void info(String format, Object[] argArray) - { - log(null, INFO, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(java.lang.String, java.lang.Throwable) - */ - public void info(String msg, Throwable t) - { - log(null, INFO, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isInfoEnabled(org.slf4j.Marker) - */ - public boolean isInfoEnabled(Marker marker) - { - return _logger.isInfoEnabled(marker); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String) - */ - public void info(Marker marker, String msg) - { - log(marker, INFO, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object) - */ - public void info(Marker marker, String format, Object arg) - { - log(marker, INFO, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object) - */ - public void info(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, INFO, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object[]) - */ - public void info(Marker marker, String format, Object[] argArray) - { - log(marker, INFO, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Throwable) - */ - public void info(Marker marker, String msg, Throwable t) - { - log(marker, INFO, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isWarnEnabled() - */ - public boolean isWarnEnabled() - { - return _logger.isWarnEnabled(); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(java.lang.String) - */ - public void warn(String msg) - { - log(null, WARN, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Object) - */ - public void warn(String format, Object arg) - { - log(null, WARN, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Object[]) - */ - public void warn(String format, Object[] argArray) - { - log(null, WARN, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Object, java.lang.Object) - */ - public void warn(String format, Object arg1, Object arg2) - { - log(null, WARN, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(java.lang.String, java.lang.Throwable) - */ - public void warn(String msg, Throwable t) - { - log(null, WARN, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isWarnEnabled(org.slf4j.Marker) - */ - public boolean isWarnEnabled(Marker marker) - { - return _logger.isWarnEnabled(marker); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String) - */ - public void warn(Marker marker, String msg) - { - log(marker, WARN, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object) - */ - public void warn(Marker marker, String format, Object arg) - { - log(marker, WARN, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object) - */ - public void warn(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, WARN, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object[]) - */ - public void warn(Marker marker, String format, Object[] argArray) - { - log(marker, WARN, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Throwable) - */ - public void warn(Marker marker, String msg, Throwable t) - { - log(marker, WARN, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isErrorEnabled() - */ - public boolean isErrorEnabled() - { - return _logger.isErrorEnabled(); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(java.lang.String) - */ - public void error(String msg) - { - log(null, ERROR, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(java.lang.String, java.lang.Object) - */ - public void error(String format, Object arg) - { - log(null, ERROR, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(java.lang.String, java.lang.Object, java.lang.Object) - */ - public void error(String format, Object arg1, Object arg2) - { - log(null, ERROR, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(java.lang.String, java.lang.Object[]) - */ - public void error(String format, Object[] argArray) - { - log(null, ERROR, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(java.lang.String, java.lang.Throwable) - */ - public void error(String msg, Throwable t) - { - log(null, ERROR, msg, null, t); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#isErrorEnabled(org.slf4j.Marker) - */ - public boolean isErrorEnabled(Marker marker) - { - return _logger.isErrorEnabled(marker); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String) - */ - public void error(Marker marker, String msg) - { - log(marker, ERROR, msg, null, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object) - */ - public void error(Marker marker, String format, Object arg) - { - log(marker, ERROR, format, new Object[]{arg}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object) - */ - public void error(Marker marker, String format, Object arg1, Object arg2) - { - log(marker, ERROR, format, new Object[]{arg1,arg2}, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object[]) - */ - public void error(Marker marker, String format, Object[] argArray) - { - log(marker, ERROR, format, argArray, null); - } - - /* ------------------------------------------------------------ */ - /** - * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Throwable) - */ - public void error(Marker marker, String msg, Throwable t) - { - log(marker, ERROR, msg, null, t); - } - - @Override - public String toString() - { - return _logger.toString(); - } - - private void log(Marker marker, int level, String msg, Object[] argArray, Throwable t) - { - if (argArray == null) - { - // Simple SLF4J Message (no args) - _logger.log(marker, FQCN, level, msg, null, t); - } - else - { - int loggerLevel = _logger.isTraceEnabled() ? TRACE : - _logger.isDebugEnabled() ? DEBUG : - _logger.isInfoEnabled() ? INFO : - _logger.isWarnEnabled() ? WARN : ERROR; - if (loggerLevel <= level) - { - // Don't assume downstream handles argArray properly. - // Do it the SLF4J way here to eliminate that as a bug. - FormattingTuple ft = MessageFormatter.arrayFormat(msg, argArray); - _logger.log(marker, FQCN, level, ft.getMessage(), null, t); - } - } - } -}
--- a/src/org/eclipse/jetty/util/log/Log.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,462 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Collection; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.Loader; - -/** - * Logging. - * This class provides a static logging interface. If an instance of the - * org.slf4j.Logger class is found on the classpath, the static log methods - * are directed to a slf4j logger for "org.eclipse.log". Otherwise the logs - * are directed to stderr. - * <p> - * The "org.eclipse.jetty.util.log.class" system property can be used - * to select a specific logging implementation. - * <p> - * If the system property org.eclipse.jetty.util.log.IGNORED is set, - * then ignored exceptions are logged in detail. - * - * @see StdErrLog - * @see Slf4jLog - */ -public class Log -{ - public final static String EXCEPTION= "EXCEPTION "; - public final static String IGNORED= "IGNORED "; - - /** - * Logging Configuration Properties - */ - protected static Properties __props; - /** - * The {@link Logger} implementation class name - */ - public static String __logClass; - /** - * Legacy flag indicating if {@link Log#ignore(Throwable)} methods produce any output in the {@link Logger}s - */ - public static boolean __ignored; - - /** - * Hold loggers only. - */ - private final static ConcurrentMap<String, Logger> __loggers = new ConcurrentHashMap<String, Logger>(); - - - static - { - /* Instantiate a default configuration properties (empty) - */ - __props = new Properties(); - - AccessController.doPrivileged(new PrivilegedAction<Object>() - { - public Object run() - { - /* First see if the jetty-logging.properties object exists in the classpath. - * This is an optional feature used by embedded mode use, and test cases to allow for early - * configuration of the Log class in situations where access to the System.properties are - * either too late or just impossible. - */ - URL testProps = Loader.getResource(Log.class,"jetty-logging.properties",true); - if (testProps != null) - { - InputStream in = null; - try - { - in = testProps.openStream(); - __props.load(in); - } - catch (IOException e) - { - System.err.println("Unable to load " + testProps); - e.printStackTrace(System.err); - } - finally - { - IO.close(in); - } - } - - /* Now load the System.properties as-is into the __props, these values will override - * any key conflicts in __props. - */ - @SuppressWarnings("unchecked") - Enumeration<String> systemKeyEnum = (Enumeration<String>)System.getProperties().propertyNames(); - while (systemKeyEnum.hasMoreElements()) - { - String key = systemKeyEnum.nextElement(); - String val = System.getProperty(key); - //protect against application code insertion of non-String values (returned as null) - if (val != null) - __props.setProperty(key,val); - } - - /* Now use the configuration properties to configure the Log statics - */ - __logClass = __props.getProperty("org.eclipse.jetty.util.log.class","org.eclipse.jetty.util.log.Slf4jLog"); - __ignored = Boolean.parseBoolean(__props.getProperty("org.eclipse.jetty.util.log.IGNORED","false")); - return null; - } - }); - } - - private static Logger LOG; - private static boolean __initialized; - - public static boolean initialized() - { - if (LOG != null) - { - return true; - } - - synchronized (Log.class) - { - if (__initialized) - { - return LOG != null; - } - __initialized = true; - } - - try - { - Class<?> log_class = Loader.loadClass(Log.class, __logClass); - if (LOG == null || !LOG.getClass().equals(log_class)) - { - LOG = (Logger)log_class.newInstance(); - LOG.debug("Logging to {} via {}", LOG, log_class.getName()); - } - } - catch(Throwable e) - { - // Unable to load specified Logger implementation, default to standard logging. - initStandardLogging(e); - } - - return LOG != null; - } - - private static void initStandardLogging(Throwable e) - { - Class<?> log_class; - if(e != null && __ignored) - { - e.printStackTrace(); - } - - if (LOG == null) - { - log_class = StdErrLog.class; - LOG = new StdErrLog(); - LOG.debug("Logging to {} via {}", LOG, log_class.getName()); - } - } - - public static void setLog(Logger log) - { - Log.LOG = log; - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static Logger getLog() - { - initialized(); - return LOG; - } - - /** - * Get the root logger. - * @return the root logger - */ - public static Logger getRootLogger() { - initialized(); - return LOG; - } - - static boolean isIgnored() - { - return __ignored; - } - - /** - * Set Log to parent Logger. - * <p> - * If there is a different Log class available from a parent classloader, - * call {@link #getLogger(String)} on it and construct a {@link LoggerLog} instance - * as this Log's Logger, so that logging is delegated to the parent Log. - * <p> - * This should be used if a webapp is using Log, but wishes the logging to be - * directed to the containers log. - * <p> - * If there is not parent Log, then this call is equivalent to<pre> - * Log.setLog(Log.getLogger(name)); - * </pre> - * @param name Logger name - */ - public static void setLogToParent(String name) - { - ClassLoader loader = Log.class.getClassLoader(); - if (loader!=null && loader.getParent()!=null) - { - try - { - Class<?> uberlog = loader.getParent().loadClass("org.eclipse.jetty.util.log.Log"); - Method getLogger = uberlog.getMethod("getLogger", new Class[]{String.class}); - Object logger = getLogger.invoke(null,name); - setLog(new LoggerLog(logger)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - else - { - setLog(getLogger(name)); - } - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void debug(Throwable th) - { - if (!isDebugEnabled()) - return; - LOG.debug(EXCEPTION, th); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void debug(String msg) - { - if (!initialized()) - return; - LOG.debug(msg); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void debug(String msg, Object arg) - { - if (!initialized()) - return; - LOG.debug(msg, arg); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void debug(String msg, Object arg0, Object arg1) - { - if (!initialized()) - return; - LOG.debug(msg, arg0, arg1); - } - - /** - * Ignore an exception unless trace is enabled. - * This works around the problem that log4j does not support the trace level. - * @param thrown the Throwable to ignore - */ - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void ignore(Throwable thrown) - { - if (!initialized()) - return; - LOG.ignore(thrown); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void info(String msg) - { - if (!initialized()) - return; - LOG.info(msg); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void info(String msg, Object arg) - { - if (!initialized()) - return; - LOG.info(msg, arg); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void info(String msg, Object arg0, Object arg1) - { - if (!initialized()) - return; - LOG.info(msg, arg0, arg1); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static boolean isDebugEnabled() - { - if (!initialized()) - return false; - return LOG.isDebugEnabled(); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void warn(String msg) - { - if (!initialized()) - return; - LOG.warn(msg); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void warn(String msg, Object arg) - { - if (!initialized()) - return; - LOG.warn(msg, arg); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void warn(String msg, Object arg0, Object arg1) - { - if (!initialized()) - return; - LOG.warn(msg, arg0, arg1); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void warn(String msg, Throwable th) - { - if (!initialized()) - return; - LOG.warn(msg, th); - } - - /** - * @deprecated anonymous logging is deprecated, use a named {@link Logger} obtained from {@link #getLogger(String)} - */ - @Deprecated - public static void warn(Throwable th) - { - if (!initialized()) - return; - LOG.warn(EXCEPTION, th); - } - - /** - * Obtain a named Logger based on the fully qualified class name. - * - * @param clazz - * the class to base the Logger name off of - * @return the Logger with the given name - */ - public static Logger getLogger(Class<?> clazz) - { - return getLogger(clazz.getName()); - } - - /** - * Obtain a named Logger or the default Logger if null is passed. - * @param name the Logger name - * @return the Logger with the given name - */ - public static Logger getLogger(String name) - { - if (!initialized()) - return null; - - if(name==null) - return LOG; - - Logger logger = __loggers.get(name); - if(logger==null) - logger = LOG.getLogger(name); - - return logger; - } - - static ConcurrentMap<String, Logger> getMutableLoggers() - { - return __loggers; - } - - /** - * Get a map of all configured {@link Logger} instances. - * - * @return a map of all configured {@link Logger} instances - */ - public static Map<String, Logger> getLoggers() - { - return Collections.unmodifiableMap(__loggers); - } -}
--- a/src/org/eclipse/jetty/util/log/Logger.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -/** - * A simple logging facade that is intended simply to capture the style of logging as used by Jetty. - */ -public interface Logger -{ - /** - * @return the name of this logger - */ - public String getName(); - - /** - * Formats and logs at warn level. - * @param msg the formatting string - * @param args the optional arguments - */ - public void warn(String msg, Object... args); - - /** - * Logs the given Throwable information at warn level - * @param thrown the Throwable to log - */ - public void warn(Throwable thrown); - - /** - * Logs the given message at warn level, with Throwable information. - * @param msg the message to log - * @param thrown the Throwable to log - */ - public void warn(String msg, Throwable thrown); - - /** - * Formats and logs at info level. - * @param msg the formatting string - * @param args the optional arguments - */ - public void info(String msg, Object... args); - - /** - * Logs the given Throwable information at info level - * @param thrown the Throwable to log - */ - public void info(Throwable thrown); - - /** - * Logs the given message at info level, with Throwable information. - * @param msg the message to log - * @param thrown the Throwable to log - */ - public void info(String msg, Throwable thrown); - - /** - * @return whether the debug level is enabled - */ - public boolean isDebugEnabled(); - - /** - * Mutator used to turn debug on programmatically. - * @param enabled whether to enable the debug level - */ - public void setDebugEnabled(boolean enabled); - - /** - * Formats and logs at debug level. - * @param msg the formatting string - * @param args the optional arguments - */ - public void debug(String msg, Object... args); - - /** - * Logs the given Throwable information at debug level - * @param thrown the Throwable to log - */ - public void debug(Throwable thrown); - - /** - * Logs the given message at debug level, with Throwable information. - * @param msg the message to log - * @param thrown the Throwable to log - */ - public void debug(String msg, Throwable thrown); - - /** - * @param name the name of the logger - * @return a logger with the given name - */ - public Logger getLogger(String name); - - /** - * Ignore an exception. - * <p>This should be used rather than an empty catch block. - */ - public void ignore(Throwable ignored); -}
--- a/src/org/eclipse/jetty/util/log/LoggerLog.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.lang.reflect.Method; - -/** - * - */ -public class LoggerLog extends AbstractLogger -{ - private final Object _logger; - private final Method _debugMT; - private final Method _debugMAA; - private final Method _infoMT; - private final Method _infoMAA; - private final Method _warnMT; - private final Method _warnMAA; - private final Method _setDebugEnabledE; - private final Method _getLoggerN; - private final Method _getName; - private volatile boolean _debug; - - public LoggerLog(Object logger) - { - try - { - _logger = logger; - Class<?> lc = logger.getClass(); - _debugMT = lc.getMethod("debug", new Class[]{String.class, Throwable.class}); - _debugMAA = lc.getMethod("debug", new Class[]{String.class, Object[].class}); - _infoMT = lc.getMethod("info", new Class[]{String.class, Throwable.class}); - _infoMAA = lc.getMethod("info", new Class[]{String.class, Object[].class}); - _warnMT = lc.getMethod("warn", new Class[]{String.class, Throwable.class}); - _warnMAA = lc.getMethod("warn", new Class[]{String.class, Object[].class}); - Method _isDebugEnabled = lc.getMethod("isDebugEnabled"); - _setDebugEnabledE = lc.getMethod("setDebugEnabled", new Class[]{Boolean.TYPE}); - _getLoggerN = lc.getMethod("getLogger", new Class[]{String.class}); - _getName = lc.getMethod("getName"); - - _debug = (Boolean)_isDebugEnabled.invoke(_logger); - } - catch(Exception x) - { - throw new IllegalStateException(x); - } - } - - public String getName() - { - try - { - return (String)_getName.invoke(_logger); - } - catch (Exception e) - { - e.printStackTrace(); - return null; - } - } - - public void warn(String msg, Object... args) - { - try - { - _warnMAA.invoke(_logger, args); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public void warn(Throwable thrown) - { - warn("", thrown); - } - - public void warn(String msg, Throwable thrown) - { - try - { - _warnMT.invoke(_logger, msg, thrown); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public void info(String msg, Object... args) - { - try - { - _infoMAA.invoke(_logger, args); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public void info(Throwable thrown) - { - info("", thrown); - } - - public void info(String msg, Throwable thrown) - { - try - { - _infoMT.invoke(_logger, msg, thrown); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public boolean isDebugEnabled() - { - return _debug; - } - - public void setDebugEnabled(boolean enabled) - { - try - { - _setDebugEnabledE.invoke(_logger, enabled); - _debug = enabled; - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public void debug(String msg, Object... args) - { - if (!_debug) - return; - - try - { - _debugMAA.invoke(_logger, args); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public void debug(Throwable thrown) - { - debug("", thrown); - } - - public void debug(String msg, Throwable th) - { - if (!_debug) - return; - - try - { - _debugMT.invoke(_logger, msg, th); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - public void ignore(Throwable ignored) - { - if (Log.isIgnored()) - { - warn(Log.IGNORED, ignored); - } - } - - /** - * Create a Child Logger of this Logger. - */ - protected Logger newLogger(String fullname) - { - try - { - Object logger=_getLoggerN.invoke(_logger, fullname); - return new LoggerLog(logger); - } - catch (Exception e) - { - e.printStackTrace(); - return this; - } - } -}
--- a/src/org/eclipse/jetty/util/log/Slf4jLog.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - - - -/** - * Slf4jLog Logger - */ -public class Slf4jLog extends AbstractLogger -{ - private final org.slf4j.Logger _logger; - - public Slf4jLog() throws Exception - { - this("org.eclipse.jetty.util.log"); - } - - public Slf4jLog(String name) - { - //NOTE: if only an slf4j-api jar is on the classpath, slf4j will use a NOPLogger - org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger( name ); - - // Fix LocationAwareLogger use to indicate FQCN of this class - - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=276670 - if (logger instanceof org.slf4j.spi.LocationAwareLogger) - { - _logger = new JettyAwareLogger((org.slf4j.spi.LocationAwareLogger)logger); - } - else - { - _logger = logger; - } - } - - public String getName() - { - return _logger.getName(); - } - - public void warn(String msg, Object... args) - { - _logger.warn(msg, args); - } - - public void warn(Throwable thrown) - { - warn("", thrown); - } - - public void warn(String msg, Throwable thrown) - { - _logger.warn(msg, thrown); - } - - public void info(String msg, Object... args) - { - _logger.info(msg, args); - } - - public void info(Throwable thrown) - { - info("", thrown); - } - - public void info(String msg, Throwable thrown) - { - _logger.info(msg, thrown); - } - - public void debug(String msg, Object... args) - { - _logger.debug(msg, args); - } - - public void debug(Throwable thrown) - { - debug("", thrown); - } - - public void debug(String msg, Throwable thrown) - { - _logger.debug(msg, thrown); - } - - public boolean isDebugEnabled() - { - return _logger.isDebugEnabled(); - } - - public void setDebugEnabled(boolean enabled) - { - warn("setDebugEnabled not implemented",null,null); - } - - /** - * Create a Child Logger of this Logger. - */ - protected Logger newLogger(String fullname) - { - return new Slf4jLog(fullname); - } - - public void ignore(Throwable ignored) - { - if (Log.isIgnored()) - { - warn(Log.IGNORED, ignored); - } - } - - @Override - public String toString() - { - return _logger.toString(); - } -}
--- a/src/org/eclipse/jetty/util/log/StdErrLog.java Fri Sep 09 17:10:47 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,630 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.util.log; - -import java.io.PrintStream; -import java.security.AccessControlException; -import java.util.Properties; - -import org.eclipse.jetty.util.DateCache; - -/** - * StdErr Logging. This implementation of the Logging facade sends all logs to StdErr with minimal formatting. - * <p> - * If the system property "org.eclipse.jetty.LEVEL" is set to one of the following (ALL, DEBUG, INFO, WARN), then set - * the eclipse jetty root level logger level to that specified level. (Default level is INFO) - * <p> - * If the system property "org.eclipse.jetty.util.log.SOURCE" is set, then the source method/file of a log is logged. - * For named debuggers, the system property name+".SOURCE" is checked, eg "org.eclipse.jetty.util.log.stderr.SOURCE". - * If it is not not set, then "org.eclipse.jetty.util.log.SOURCE" is used as the default. - * <p> - * If the system property "org.eclipse.jetty.util.log.stderr.LONG" is set, then the full, unabbreviated name of the logger is - * used for logging. - */ -public class StdErrLog extends AbstractLogger -{ - private static final String EOL = System.getProperty("line.separator"); - private static DateCache _dateCache; - private static final Properties __props = new Properties(); - - private final static boolean __source = Boolean.parseBoolean(Log.__props.getProperty("org.eclipse.jetty.util.log.SOURCE", - Log.__props.getProperty("org.eclipse.jetty.util.log.stderr.SOURCE","false"))); - private final static boolean __long = Boolean.parseBoolean(Log.__props.getProperty("org.eclipse.jetty.util.log.stderr.LONG","false")); - - static - { - __props.putAll(Log.__props); - - String deprecatedProperties[] = - { "DEBUG", "org.eclipse.jetty.util.log.DEBUG", "org.eclipse.jetty.util.log.stderr.DEBUG" }; - - // Toss a message to users about deprecated system properties - for (String deprecatedProp : deprecatedProperties) - { - if (System.getProperty(deprecatedProp) != null) - { - System.err.printf("System Property [%s] has been deprecated! (Use org.eclipse.jetty.LEVEL=DEBUG instead)%n",deprecatedProp); - } - } - - try - { - _dateCache = new DateCache("yyyy-MM-dd HH:mm:ss"); - } - catch (Exception x) - { - x.printStackTrace(System.err); - } - } - - public static final int LEVEL_ALL = 0; - public static final int LEVEL_DEBUG = 1; - public static final int LEVEL_INFO = 2; - public static final int LEVEL_WARN = 3; - - private int _level = LEVEL_INFO; - // Level that this Logger was configured as (remembered in special case of .setDebugEnabled()) - private int _configuredLevel; - private PrintStream _stderr = null; - private boolean _source = __source; - // Print the long form names, otherwise use abbreviated - private boolean _printLongNames = __long; - // The full log name, as provided by the system. - private final String _name; - // The abbreviated log name (used by default, unless _long is specified) - private final String _abbrevname; - private boolean _hideStacks = false; - - public StdErrLog() - { - this(null); - } - - public StdErrLog(String name) - { - this(name,__props); - } - - public StdErrLog(String name, Properties props) - { - if (props!=null && props!=__props) - __props.putAll(props); - this._name = name == null?"":name; - this._abbrevname = condensePackageString(this._name); - this._level = getLoggingLevel(props,this._name); - this._configuredLevel = this._level; - - try - { - _source = Boolean.parseBoolean(props.getProperty(_name + ".SOURCE",Boolean.toString(_source))); - } - catch (AccessControlException ace) - { - _source = __source; - } - } - - /** - * Get the Logging Level for the provided log name. Using the FQCN first, then each package segment from longest to - * shortest. - * - * @param props - * the properties to check - * @param name - * the name to get log for - * @return the logging level - */ - public static int getLoggingLevel(Properties props, final String name) - { - // Calculate the level this named logger should operate under. - // Checking with FQCN first, then each package segment from longest to shortest. - String nameSegment = name; - - while ((nameSegment != null) && (nameSegment.length() > 0)) - { - String levelStr = props.getProperty(nameSegment + ".LEVEL"); - // System.err.printf("[StdErrLog.CONFIG] Checking for property [%s.LEVEL] = %s%n",nameSegment,levelStr); - int level = getLevelId(nameSegment + ".LEVEL",levelStr); - if (level != (-1)) - { - return level; - } - - // Trim and try again. - int idx = nameSegment.lastIndexOf('.'); - if (idx >= 0) - { - nameSegment = nameSegment.substring(0,idx); - } - else - { - nameSegment = null; - } - } - - // Default Logging Level - return getLevelId("log.LEVEL",props.getProperty("log.LEVEL","INFO")); - } - - protected static int getLevelId(String levelSegment, String levelName) - { - if (levelName == null) - { - return -1; - } - String levelStr = levelName.trim(); - if ("ALL".equalsIgnoreCase(levelStr)) - { - return LEVEL_ALL; - } - else if ("DEBUG".equalsIgnoreCase(levelStr)) - { - return LEVEL_DEBUG; - } - else if ("INFO".equalsIgnoreCase(levelStr)) - { - return LEVEL_INFO; - } - else if ("WARN".equalsIgnoreCase(levelStr)) - { - return LEVEL_WARN; - } - - System.err.println("Unknown StdErrLog level [" + levelSegment + "]=[" + levelStr + "], expecting only [ALL, DEBUG, INFO, WARN] as values."); - return -1; - } - - /** - * Condenses a classname by stripping down the package name to just the first character of each package name - * segment.Configured - * <p> - * - * <pre> - * Examples: - * "org.eclipse.jetty.test.FooTest" = "oejt.FooTest" - * "org.eclipse.jetty.server.logging.LogTest" = "orjsl.LogTest" - * </pre> - * - * @param classname - * the fully qualified class name - * @return the condensed name - */ - protected static String condensePackageString(String classname) - { - String parts[] = classname.split("\\."); - StringBuilder dense = new StringBuilder(); - for (int i = 0; i < (parts.length - 1); i++) - { - dense.append(parts[i].charAt(0)); - } - if (dense.length() > 0) - { - dense.append('.'); - } - dense.append(parts[parts.length - 1]); - return dense.toString(); - } - - public String getName() - { - return _name; - } - - public void setPrintLongNames(boolean printLongNames) - { - this._printLongNames = printLongNames; - } - - public boolean isPrintLongNames() - { - return this._printLongNames; - } - - public boolean isHideStacks() - { - return _hideStacks; - } - - public void setHideStacks(boolean hideStacks) - { - _hideStacks = hideStacks; - } - - /* ------------------------------------------------------------ */ - /** - * Is the source of a log, logged - * - * @return true if the class, method, file and line number of a log is logged. - */ - public boolean isSource() - { - return _source; - } - - /* ------------------------------------------------------------ */ - /** - * Set if a log source is logged. - * - * @param source - * true if the class, method, file and line number of a log is logged. - */ - public void setSource(boolean source) - { - _source = source; - } - - public void warn(String msg, Object... args) - { - if (_level <= LEVEL_WARN) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":WARN:",msg,args); - (_stderr==null?System.err:_stderr).println(buffer); - } - } - - public void warn(Throwable thrown) - { - warn("",thrown); - } - - public void warn(String msg, Throwable thrown) - { - if (_level <= LEVEL_WARN) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":WARN:",msg,thrown); - (_stderr==null?System.err:_stderr).println(buffer); - } - } - - public void info(String msg, Object... args) - { - if (_level <= LEVEL_INFO) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":INFO:",msg,args); - (_stderr==null?System.err:_stderr).println(buffer); - } - } - - public void info(Throwable thrown) - { - info("",thrown); - } - - public void info(String msg, Throwable thrown) - { - if (_level <= LEVEL_INFO) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":INFO:",msg,thrown); - (_stderr==null?System.err:_stderr).println(buffer); - } - } - - public boolean isDebugEnabled() - { - return (_level <= LEVEL_DEBUG); - } - - /** - * Legacy interface where a programmatic configuration of the logger level - * is done as a wholesale approach. - */ - public void setDebugEnabled(boolean enabled) - { - if (enabled) - { - this._level = LEVEL_DEBUG; - - for (Logger log : Log.getLoggers().values()) - { - if (log.getName().startsWith(getName()) && log instanceof StdErrLog) - ((StdErrLog)log).setLevel(LEVEL_DEBUG); - } - } - else - { - this._level = this._configuredLevel; - - for (Logger log : Log.getLoggers().values()) - { - if (log.getName().startsWith(getName()) && log instanceof StdErrLog) - ((StdErrLog)log).setLevel(((StdErrLog)log)._configuredLevel); - } - } - } - - public int getLevel() - { - return _level; - } - - /** - * Set the level for this logger. - * <p> - * Available values ({@link StdErrLog#LEVEL_ALL}, {@link StdErrLog#LEVEL_DEBUG}, {@link StdErrLog#LEVEL_INFO}, - * {@link StdErrLog#LEVEL_WARN}) - * - * @param level - * the level to set the logger to - */ - public void setLevel(int level) - { - this._level = level; - } - - public void setStdErrStream(PrintStream stream) - { - this._stderr = stream==System.err?null:stream; - } - - public void debug(String msg, Object... args) - { - if (_level <= LEVEL_DEBUG) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":DBUG:",msg,args); - (_stderr==null?System.err:_stderr).println(buffer); - } - } - - public void debug(Throwable thrown) - { - debug("",thrown); - } - - public void debug(String msg, Throwable thrown) - { - if (_level <= LEVEL_DEBUG) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":DBUG:",msg,thrown); - (_stderr==null?System.err:_stderr).println(buffer); - } - } - - private void format(StringBuilder buffer, String level, String msg, Object... args) - { - String d = _dateCache.now(); - int ms = _dateCache.lastMs(); - tag(buffer,d,ms,level); - format(buffer,msg,args); - } - - private void format(StringBuilder buffer, String level, String msg, Throwable thrown) - { - format(buffer,level,msg); - if (isHideStacks()) - { - format(buffer,String.valueOf(thrown)); - } - else - { - format(buffer,thrown); - } - } - - private void tag(StringBuilder buffer, String d, int ms, String tag) - { - buffer.setLength(0); - buffer.append(d); - if (ms > 99) - { - buffer.append('.'); - } - else if (ms > 9) - { - buffer.append(".0"); - } - else - { - buffer.append(".00"); - } - buffer.append(ms).append(tag); - if (_printLongNames) - { - buffer.append(_name); - } - else - { - buffer.append(_abbrevname); - } - buffer.append(':'); - if (_source) - { - Throwable source = new Throwable(); - StackTraceElement[] frames = source.getStackTrace(); - for (int i = 0; i < frames.length; i++) - { - final StackTraceElement frame = frames[i]; - String clazz = frame.getClassName(); - if (clazz.equals(StdErrLog.class.getName()) || clazz.equals(Log.class.getName())) - { - continue; - } - if (!_printLongNames && clazz.startsWith("org.eclipse.jetty.")) - { - buffer.append(condensePackageString(clazz)); - } - else - { - buffer.append(clazz); - } - buffer.append('#').append(frame.getMethodName()); - if (frame.getFileName() != null) - { - buffer.append('(').append(frame.getFileName()).append(':').append(frame.getLineNumber()).append(')'); - } - buffer.append(':'); - break; - } - } - } - - private void format(StringBuilder builder, String msg, Object... args) - { - if (msg == null) - { - msg = ""; - for (int i = 0; i < args.length; i++) - { - msg += "{} "; - } - } - String braces = "{}"; - int start = 0; - for (Object arg : args) - { - int bracesIndex = msg.indexOf(braces,start); - if (bracesIndex < 0) - { - escape(builder,msg.substring(start)); - builder.append(" "); - builder.append(arg); - start = msg.length(); - } - else - { - escape(builder,msg.substring(start,bracesIndex)); - builder.append(String.valueOf(arg)); - start = bracesIndex + braces.length(); - } - } - escape(builder,msg.substring(start)); - } - - private void escape(StringBuilder builder, String string) - { - for (int i = 0; i < string.length(); ++i) - { - char c = string.charAt(i); - if (Character.isISOControl(c)) - { - if (c == '\n') - { - builder.append('|'); - } - else if (c == '\r') - { - builder.append('<'); - } - else - { - builder.append('?'); - } - } - else - { - builder.append(c); - } - } - } - - private void format(StringBuilder buffer, Throwable thrown) - { - if (thrown == null) - { - buffer.append("null"); - } - else - { - buffer.append(EOL); - format(buffer,thrown.toString()); - StackTraceElement[] elements = thrown.getStackTrace(); - for (int i = 0; elements != null && i < elements.length; i++) - { - buffer.append(EOL).append("\tat "); - format(buffer,elements[i].toString()); - } - - Throwable cause = thrown.getCause(); - if (cause != null && cause != thrown) - { - buffer.append(EOL).append("Caused by: "); - format(buffer,cause); - } - } - } - - - /** - * Create a Child Logger of this Logger. - */ - protected Logger newLogger(String fullname) - { - StdErrLog logger = new StdErrLog(fullname); - // Preserve configuration for new loggers configuration - logger.setPrintLongNames(_printLongNames); - // Let Level come from configured Properties instead - sel.setLevel(_level); - logger.setSource(_source); - logger._stderr = this._stderr; - - // Force the child to have any programmatic configuration - if (_level!=_configuredLevel) - logger._level=_level; - - return logger; - } - - @Override - public String toString() - { - StringBuilder s = new StringBuilder(); - s.append("StdErrLog:"); - s.append(_name); - s.append(":LEVEL="); - switch (_level) - { - case LEVEL_ALL: - s.append("ALL"); - break; - case LEVEL_DEBUG: - s.append("DEBUG"); - break; - case LEVEL_INFO: - s.append("INFO"); - break; - case LEVEL_WARN: - s.append("WARN"); - break; - default: - s.append("?"); - break; - } - return s.toString(); - } - - public static void setProperties(Properties props) - { - __props.clear(); - __props.putAll(props); - } - - public void ignore(Throwable ignored) - { - if (_level <= LEVEL_ALL) - { - StringBuilder buffer = new StringBuilder(64); - format(buffer,":IGNORED:","",ignored); - (_stderr==null?System.err:_stderr).println(buffer); - } - } -}
--- a/src/org/eclipse/jetty/util/resource/FileResource.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/resource/FileResource.java Tue Sep 13 23:13:06 2016 -0600 @@ -33,8 +33,8 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -48,7 +48,7 @@ */ public class FileResource extends URLResource { - private static final Logger LOG = Log.getLogger(FileResource.class); + private static final Logger LOG = LoggerFactory.getLogger(FileResource.class); private static boolean __checkAliases = true; /* ------------------------------------------------------------ */ @@ -91,7 +91,7 @@ } catch (Exception e) { - LOG.ignore(e); + LOG.trace("",e); try { // Assume that File.toURL produced unencoded chars. So try @@ -105,7 +105,7 @@ } catch (Exception e2) { - LOG.ignore(e2); + LOG.trace("",e2); // Still can't get the file. Doh! try good old hack! checkConnection(); @@ -207,7 +207,7 @@ } catch(Exception e) { - LOG.warn(Log.EXCEPTION,e); + LOG.warn("EXCEPTION",e); return getURL(); } }
--- a/src/org/eclipse/jetty/util/resource/JarFileResource.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/resource/JarFileResource.java Tue Sep 13 23:13:06 2016 -0600 @@ -29,13 +29,13 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ class JarFileResource extends JarResource { - private static final Logger LOG = Log.getLogger(JarFileResource.class); + private static final Logger LOG = LoggerFactory.getLogger(JarFileResource.class); private JarFile _jarFile; private File _file; private String[] _list; @@ -78,7 +78,7 @@ } catch ( IOException ioe ) { - LOG.ignore(ioe); + LOG.trace("",ioe); } } } @@ -145,7 +145,7 @@ String file_url=_urlString.substring(4,_urlString.length()-2); try{return newResource(file_url).exists();} - catch(Exception e) {LOG.ignore(e); return false;} + catch(Exception e) {LOG.trace("",e); return false;} } boolean check=checkConnection(); @@ -175,7 +175,7 @@ } catch(Exception e) { - LOG.ignore(e); + LOG.trace("",e); } } @@ -221,7 +221,7 @@ } catch(MalformedURLException ex) { - LOG.warn(ex); + LOG.warn("",ex); } } } @@ -280,7 +280,7 @@ //by other code. //So, do one retry to drop a connection and get a fresh JarFile LOG.warn("Retrying list:"+e); - LOG.debug(e); + LOG.debug("",e); release(); list = listEntries(); } @@ -314,7 +314,7 @@ { e.printStackTrace(); - LOG.ignore(e); + LOG.trace("",e); } }
--- a/src/org/eclipse/jetty/util/resource/JarResource.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/resource/JarResource.java Tue Sep 13 23:13:06 2016 -0600 @@ -31,14 +31,14 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ public class JarResource extends URLResource { - private static final Logger LOG = Log.getLogger(JarResource.class); + private static final Logger LOG = LoggerFactory.getLogger(JarResource.class); protected JarURLConnection _jarConnection; /* -------------------------------------------------------- */ @@ -73,7 +73,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); _jarConnection=null; }
--- a/src/org/eclipse/jetty/util/resource/Resource.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/resource/Resource.java Tue Sep 13 23:13:06 2016 -0600 @@ -36,8 +36,8 @@ import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -46,7 +46,7 @@ */ public abstract class Resource implements ResourceFactory { - private static final Logger LOG = Log.getLogger(Resource.class); + private static final Logger LOG = LoggerFactory.getLogger(Resource.class); public static boolean __defaultUseCaches = true; volatile Object _associate; @@ -113,7 +113,7 @@ } catch(Exception e) { - LOG.debug(Log.EXCEPTION,e); + LOG.debug("EXCEPTION",e); return new BadResource(url,e.toString()); } } @@ -178,7 +178,7 @@ } catch(Exception e2) { - LOG.debug(Log.EXCEPTION,e2); + LOG.debug("EXCEPTION",e2); throw e; } } @@ -440,7 +440,7 @@ } catch(Exception e) { - LOG.debug(e); + LOG.debug("",e); return null; } }
--- a/src/org/eclipse/jetty/util/resource/URLResource.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/resource/URLResource.java Tue Sep 13 23:13:06 2016 -0600 @@ -28,15 +28,15 @@ import java.security.Permission; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** Abstract resource class. */ public class URLResource extends Resource { - private static final Logger LOG = Log.getLogger(URLResource.class); + private static final Logger LOG = LoggerFactory.getLogger(URLResource.class); protected URL _url; protected String _urlString; @@ -70,7 +70,7 @@ } catch(IOException e) { - LOG.ignore(e); + LOG.trace("",e); } } return _connection!=null; @@ -84,7 +84,7 @@ { if (_in!=null) { - try{_in.close();}catch(IOException e){LOG.ignore(e);} + try{_in.close();}catch(IOException e){LOG.trace("",e);} _in=null; } @@ -109,7 +109,7 @@ } catch (IOException e) { - LOG.ignore(e); + LOG.trace("",e); } return _in!=null; } @@ -181,7 +181,7 @@ // Try the URL file arg try {return new File(_url.getFile());} - catch(Exception e) {LOG.ignore(e);} + catch(Exception e) {LOG.trace("",e);} // Don't know the file return null;
--- a/src/org/eclipse/jetty/util/security/CertificateValidator.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/security/CertificateValidator.java Tue Sep 13 23:13:06 2016 -0600 @@ -39,8 +39,8 @@ import java.util.Enumeration; import java.util.concurrent.atomic.AtomicLong; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Convenience class to handle validation of certificates, aliases and keystores @@ -54,7 +54,7 @@ */ public class CertificateValidator { - private static final Logger LOG = Log.getLogger(CertificateValidator.class); + private static final Logger LOG = LoggerFactory.getLogger(CertificateValidator.class); private static AtomicLong __aliasCount = new AtomicLong(); private KeyStore _trustStore; @@ -133,7 +133,7 @@ } catch (KeyStoreException kse) { - LOG.debug(kse); + LOG.debug("",kse); throw new CertificateException("Unable to validate certificate" + " for alias [" + keyAlias + "]: " + kse.getMessage(), kse); } @@ -181,7 +181,7 @@ } catch (KeyStoreException kse) { - LOG.debug(kse); + LOG.debug("",kse); throw new CertificateException("Unable to validate certificate" + (certAlias == null ? "":" for alias [" +certAlias + "]") + ": " + kse.getMessage(), kse); } @@ -252,7 +252,7 @@ } catch (GeneralSecurityException gse) { - LOG.debug(gse); + LOG.debug("",gse); throw new CertificateException("Unable to validate certificate: " + gse.getMessage(), gse); } }
--- a/src/org/eclipse/jetty/util/security/Credential.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/security/Credential.java Tue Sep 13 23:13:06 2016 -0600 @@ -23,8 +23,8 @@ import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.TypeUtil; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -43,7 +43,7 @@ */ public abstract class Credential implements Serializable { - private static final Logger LOG = Log.getLogger(Credential.class); + private static final Logger LOG = LoggerFactory.getLogger(Credential.class); private static final long serialVersionUID = -7760551052768181572L; @@ -186,7 +186,7 @@ } catch (Exception e) { - LOG.warn(e); + LOG.warn("",e); return false; } } @@ -207,7 +207,7 @@ } catch (Exception e) { - LOG.warn(e); + LOG.warn("",e); return null; } } @@ -221,7 +221,7 @@ } catch (Exception e) { - LOG.warn(e); + LOG.warn("",e); return null; } }
--- a/src/org/eclipse/jetty/util/security/Password.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/security/Password.java Tue Sep 13 23:13:06 2016 -0600 @@ -21,8 +21,8 @@ import java.io.IOException; import java.util.Arrays; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -54,7 +54,7 @@ */ public class Password extends Credential { - private static final Logger LOG = Log.getLogger(Password.class); + private static final Logger LOG = LoggerFactory.getLogger(Password.class); private static final long serialVersionUID = 5062906681431569445L; @@ -228,7 +228,7 @@ } catch (IOException e) { - LOG.warn(Log.EXCEPTION, e); + LOG.warn("EXCEPTION", e); } if (passwd == null || passwd.length() == 0) passwd = promptDft; }
--- a/src/org/eclipse/jetty/util/ssl/SslContextFactory.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/ssl/SslContextFactory.java Tue Sep 13 23:13:06 2016 -0600 @@ -56,8 +56,8 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.security.CertificateUtils; import org.eclipse.jetty.util.security.CertificateValidator; @@ -89,7 +89,7 @@ } }}; - private static final Logger LOG = Log.getLogger(SslContextFactory.class); + private static final Logger LOG = LoggerFactory.getLogger(SslContextFactory.class); public static final String DEFAULT_KEYMANAGERFACTORY_ALGORITHM = (Security.getProperty("ssl.KeyManagerFactory.algorithm") == null ?
--- a/src/org/eclipse/jetty/util/thread/ExecutorThreadPool.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/thread/ExecutorThreadPool.java Tue Sep 13 23:13:06 2016 -0600 @@ -29,8 +29,8 @@ import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ /** @@ -40,7 +40,7 @@ */ public class ExecutorThreadPool extends AbstractLifeCycle implements ThreadPool, LifeCycle { - private static final Logger LOG = Log.getLogger(ExecutorThreadPool.class); + private static final Logger LOG = LoggerFactory.getLogger(ExecutorThreadPool.class); private final ExecutorService _executor; /* ------------------------------------------------------------ */ @@ -128,7 +128,7 @@ } catch(RejectedExecutionException e) { - LOG.warn(e); + LOG.warn("",e); return false; } }
--- a/src/org/eclipse/jetty/util/thread/QueuedThreadPool.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/thread/QueuedThreadPool.java Tue Sep 13 23:13:06 2016 -0600 @@ -37,13 +37,13 @@ import org.eclipse.jetty.util.component.AggregateLifeCycle; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool; public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPool, Executor, Dumpable { - private static final Logger LOG = Log.getLogger(QueuedThreadPool.class); + private static final Logger LOG = LoggerFactory.getLogger(QueuedThreadPool.class); private final AtomicInteger _threadsStarted = new AtomicInteger(); private final AtomicInteger _threadsIdle = new AtomicInteger(); @@ -581,11 +581,11 @@ } catch(InterruptedException e) { - LOG.ignore(e); + LOG.trace("",e); } catch(Exception e) { - LOG.warn(e); + LOG.warn("",e); } finally {
--- a/src/org/eclipse/jetty/util/thread/ShutdownThread.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/thread/ShutdownThread.java Tue Sep 13 23:13:06 2016 -0600 @@ -24,8 +24,8 @@ import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.LifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -37,7 +37,7 @@ */ public class ShutdownThread extends Thread { - private static final Logger LOG = Log.getLogger(ShutdownThread.class); + private static final Logger LOG = LoggerFactory.getLogger(ShutdownThread.class); private static final ShutdownThread _thread = new ShutdownThread(); private boolean _hooked; @@ -64,7 +64,7 @@ } catch(Exception e) { - LOG.ignore(e); + LOG.trace("",e); LOG.info("shutdown already commenced"); } } @@ -79,7 +79,7 @@ } catch(Exception e) { - LOG.ignore(e); + LOG.trace("",e); LOG.debug("shutdown already commenced"); } } @@ -141,7 +141,7 @@ } catch (Exception ex) { - LOG.debug(ex); + LOG.debug("",ex); } } }
--- a/src/org/eclipse/jetty/util/thread/Timeout.java Fri Sep 09 17:10:47 2016 -0600 +++ b/src/org/eclipse/jetty/util/thread/Timeout.java Tue Sep 13 23:13:06 2016 -0600 @@ -18,8 +18,8 @@ package org.eclipse.jetty.util.thread; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /* ------------------------------------------------------------ */ @@ -33,7 +33,7 @@ */ public class Timeout { - private static final Logger LOG = Log.getLogger(Timeout.class); + private static final Logger LOG = LoggerFactory.getLogger(Timeout.class); private Object _lock; private long _duration; private volatile long _now=System.currentTimeMillis(); @@ -141,7 +141,7 @@ } catch(Throwable th) { - LOG.warn(Log.EXCEPTION,th); + LOG.warn("EXCEPTION",th); } } }