reduce logging (by assigning logger to existing logger)

- small additional cleanups
pull/1/head
reger 12 years ago
parent 332c6d4fe1
commit 53cb30a221

@ -1,19 +1,25 @@
// Jetty8YaCyDefaultServlet
// ------------------------
// Copyright 2013 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
// First released 2013 at http://yacy.net
//
// ========================================================================
// Copyright (c) 1995-2013 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.
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
// You should have received a copy of the GNU Lesser General Public License
// along with this program in the file lgpl21.txt
// If not, see <http://www.gnu.org/licenses/>.
//
package net.yacy.http;
@ -172,8 +178,8 @@ public class Jetty8YaCyDefaultServlet extends YaCyDefaultServlet implements Reso
}
}
if (ConcurrentLog.isFine("YaCyDefaultServlet")) {
ConcurrentLog.fine("YaCyDefaultServlet","uri=" + request.getRequestURI() + " resource=" + resource + (content != null ? " content" : ""));
if (ConcurrentLog.isFine("FILEHANDLER")) {
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: uri=" + request.getRequestURI() + " resource=" + resource + (content != null ? " content" : ""));
}
// Handle resource
@ -233,7 +239,7 @@ public class Jetty8YaCyDefaultServlet extends YaCyDefaultServlet implements Reso
}
} // else look for a welcome file
else if (null != (welcome = getWelcomeFile(pathInContext))) {
ConcurrentLog.fine("welcome={}", welcome);
ConcurrentLog.fine("FILEHANDLER","welcome={}" + welcome);
// Forward to the index
@ -494,7 +500,7 @@ public class Jetty8YaCyDefaultServlet extends YaCyDefaultServlet implements Reso
writeHeaders(response, content, -1);
String mimetype = (content.getContentType() == null ? null : content.getContentType().toString());
if (mimetype == null) {
ConcurrentLog.warn("YaCyDefaultServlet", "Unknown mimetype for " + request.getRequestURI());
ConcurrentLog.warn("FILEHANDLER","YaCyDefaultServlet: Unknown mimetype for " + request.getRequestURI());
}
MultiPartOutputStream multi = new MultiPartOutputStream(out);
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);

@ -82,8 +82,8 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
*/
public class TemplateHandler extends AbstractHandler implements Handler {
private String htLocalePath = "DATA/LOCALE/htroot";
private String htDefaultPath = "htroot";
private final String htLocalePath = "DATA/LOCALE/htroot";
private final String htDefaultPath = "htroot";
private String htDocsPath = "DATA/HTDOCS";
private static final serverClassLoader provider = new serverClassLoader(/*this.getClass().getClassLoader()*/);
@ -156,10 +156,10 @@ public class TemplateHandler extends AbstractHandler implements Handler {
templateMethodCache.put(classFile, new SoftReference<Method>(m));
} catch (final ClassNotFoundException e) {
ConcurrentLog.severe("TemplateHandler", "class " + classFile + " is missing:" + e.getMessage());
ConcurrentLog.severe("HTTPDFileHandler", "class " + classFile + " is missing:" + e.getMessage());
throw new InvocationTargetException(e, "class " + classFile + " is missing:" + e.getMessage());
} catch (final NoSuchMethodException e) {
ConcurrentLog.severe("TemplateHandler", "method 'respond' not found in class " + classFile + ": " + e.getMessage());
ConcurrentLog.severe("HTTPDFileHandler", "method 'respond' not found in class " + classFile + ": " + e.getMessage());
throw new InvocationTargetException(e, "method 'respond' not found in class " + classFile + ": " + e.getMessage());
}
return m;

@ -179,8 +179,8 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
_etags = getInitBoolean("etags", _etags);
_gzip=getInitBoolean("gzip",_gzip);
if (ConcurrentLog.isFine("YaCyDefaultServlet")) {
ConcurrentLog.fine("YaCyDefaultServlet","resource base = " + _resourceBase);
if (ConcurrentLog.isFine("FILEHANDLER")) {
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: resource base = " + _resourceBase);
}
templateMethodCache = new ConcurrentHashMap<File, SoftReference<Method>>();
}
@ -222,8 +222,8 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
r = Resource.newResource(u);
}
if (ConcurrentLog.isFine("YaCyDefaultServlet")) {
ConcurrentLog.fine("YaCyDefaultServlet","Resource " + pathInContext + "=" + r);
if (ConcurrentLog.isFine("FILEHANDLER")) {
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: Resource " + pathInContext + "=" + r);
}
} catch (IOException e) {
// ConcurrentLog.logException(e);
@ -286,8 +286,8 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
// find resource
resource = getResource(pathInContext);
if (ConcurrentLog.isFine("YaCyDefaultServlet")) {
ConcurrentLog.fine("YaCyDefaultServlet","uri=" + request.getRequestURI() + " resource=" + resource + (content != null ? " content" : ""));
if (ConcurrentLog.isFine("FILEHANDLER")) {
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: uri=" + request.getRequestURI() + " resource=" + resource + (content != null ? " content" : ""));
}
// Handle resource
@ -553,10 +553,10 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
templateMethodCache.put(classFile, new SoftReference<Method>(m));
} catch (final ClassNotFoundException e) {
ConcurrentLog.severe("YaCyDefaultServlet", "class " + classFile + " is missing:" + e.getMessage());
ConcurrentLog.severe("FILEHANDLER","YaCyDefaultServlet: class " + classFile + " is missing:" + e.getMessage());
throw new InvocationTargetException(e, "class " + classFile + " is missing:" + e.getMessage());
} catch (final NoSuchMethodException e) {
ConcurrentLog.severe("YaCyDefaultServlet", "method 'respond' not found in class " + classFile + ": " + e.getMessage());
ConcurrentLog.severe("FILEHANDLER","YaCyDefaultServlet: method 'respond' not found in class " + classFile + ": " + e.getMessage());
throw new InvocationTargetException(e, "method 'respond' not found in class " + classFile + ": " + e.getMessage());
}
return m;

@ -219,7 +219,7 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
continue;
}
} catch (final MalformedURLException e) {
ConcurrentLog.fine("ProxyServlet", "malformed url for url-rewirte " + url);
ConcurrentLog.fine("PROXY","ProxyServlet: malformed url for url-rewirte " + url);
continue;
}
}
@ -237,7 +237,7 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
continue;
}
} catch (MalformedURLException ex) {
ConcurrentLog.fine("ProxyServlet", "malformed url for url-rewirte " + complete_url);
ConcurrentLog.fine("PROXY","ProxyServlet: malformed url for url-rewirte " + complete_url);
continue;
}
}

Loading…
Cancel
Save