org.eclipse.jetty.util.log.Logger类的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(15.2k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中org.eclipse.jetty.util.log.Logger类的一些代码示例,展示了Logger类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger类的具体详情如下:
包路径:org.eclipse.jetty.util.log.Logger
类名称:Logger

Logger介绍

[英]A simple logging facade that is intended simply to capture the style of logging as used by Jetty.
[中]一个简单的日志外观,旨在简单地捕获Jetty使用的日志样式。

代码示例

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

if (resourcesDir == EmptyResource.INSTANCE)
    if (LOG.isDebugEnabled()) LOG.debug(target+" cached as containing no META-INF/resources");
    return;    
    if (LOG.isDebugEnabled()) LOG.debug(target+" META-INF/resources found in cache ");
  if (LOG.isDebugEnabled()) LOG.debug(target+" META-INF/resources checked");
  if (target.isDirectory())
    resourcesDir = target.addPath("/META-INF/resources");
    URI uri = target.getURI();
    resourcesDir = Resource.newResource(uriJarPrefix(uri,"!/META-INF/resources"));
      resourcesDir = old;
    else
      if (LOG.isDebugEnabled()) LOG.debug(target+" META-INF/resources cache updated");
Set<Resource> dirs = (Set<Resource>)context.getAttribute(METAINF_RESOURCES);
if (dirs == null)
  context.setAttribute(METAINF_RESOURCES, dirs);
if (LOG.isDebugEnabled()) LOG.debug(resourcesDir+" added to context");

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

if (context.isStarted())
  LOG.debug("Cannot configure webapp after it is started");
  return;
LOG.debug("Configuring web-jetty.xml");
Resource web_inf = context.getWebInf();
if(web_inf!=null&&web_inf.isDirectory())
  Resource jetty=web_inf.addPath("jetty8-web.xml");
  if(!jetty.exists())
    jetty=web_inf.addPath(JETTY_WEB_XML);
  if(!jetty.exists())
  if(jetty.exists())
    if(LOG.isDebugEnabled())
      LOG.debug("Configure: "+jetty);
    Object xml_attr=context.getAttribute(XML_CONFIGURATION);
    context.removeAttribute(XML_CONFIGURATION);
    final XmlConfiguration jetty_config = xml_attr instanceof XmlConfiguration?(XmlConfiguration)xml_attr:new XmlConfiguration(jetty.getURI().toURL());
      LOG.warn("Error applying {}",jetty);
      throw e;

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

private void dumpUrl()
{
  Connector[] connectors = getServer().getConnectors();
  for (int i=0;i<connectors.length;i++)
  {
    String displayName = getDisplayName();
    if (displayName == null)
      displayName = "WebApp@"+Arrays.hashCode(connectors);
    LOG.info(displayName + " at http://" + connectors[i].toString() + getContextPath());
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

@Override
public boolean isSystemResource(String name, URL url)
{
  if (_systemClasses == null)
    loadSystemClasses();
  boolean result = _systemClasses.match(name,url);
  if (LOG.isDebugEnabled())
    LOG.debug("isSystemResource=={} {} {}",result,name,url);
  return result;
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

@Override
public boolean isServerClass(Class<?> clazz)
{
  if (_serverClasses == null)
    loadServerClasses();
  boolean result = _serverClasses.match(clazz);
  if (LOG.isDebugEnabled())
    LOG.debug("isServerClass=={} {}",result,clazz);
  return result;
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

@Override
public Class<?> loadClass(String name) throws ClassNotFoundException
{
  if (_notFound.contains(name))
  {
    if (LOG.isDebugEnabled())
      LOG.debug("Not found cache hit resource {}",name);
    throw new ClassNotFoundException(name+": in notfound cache");
  }
  try
  {
    return super.loadClass(name);
  }
  catch (ClassNotFoundException nfe)
  {
    if (_notFound.add(name))
      if (LOG.isDebugEnabled())
      {
        LOG.debug("Caching not found {}",name);
        LOG.debug(nfe);
      }
    throw nfe; 
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-security

LOG.debug("jsecuritycheck {} {}",username,user);
  LOG.debug("authenticated {}->{}",form_auth,nuri);
if (LOG.isDebugEnabled())
  LOG.debug("Form authentication FAILED for " + StringUtil.printable(username));
if (_formErrorPage == null)
  LOG.debug("auth failed {}->403",username);
  if (response != null)
    response.sendError(HttpServletResponse.SC_FORBIDDEN);
  LOG.debug("auth failed {}=={}",username,_formErrorPage);
  LOG.debug("auth failed {}->{}",username,_formErrorPage);
  int redirectCode = (base_request.getHttpVersion().getVersion() < HttpVersion.HTTP_1_1.getVersion() ? HttpServletResponse.SC_MOVED_TEMPORARILY : HttpServletResponse.SC_SEE_OTHER);
  base_response.sendRedirect(redirectCode, response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),_formErrorPage)));
  LOG.debug("auth revoked {}",authentication);
  session.removeAttribute(SessionAuthentication.__J_AUTHENTICATED);
      LOG.debug("auth retry {}->{}",authentication,j_uri);
          LOG.debug("auth rePOST {}->{}",authentication,j_uri);
  LOG.debug("auth {}",authentication);
  return authentication;
LOG.debug("auth deferred {}",session == null ? null : session.getId());

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
  if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  {
    LOG.debug("CONNECT request for {}", request.getRequestURI());
    try
    {
      handleConnect(baseRequest, request, response, request.getRequestURI());
    }
    catch(Exception e)
    {
      LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
      LOG.debug(e);
    }
  }
  else
  {
    super.handle(target, baseRequest, request, response);
  }
}

代码示例来源:origin: org.eclipse.jetty/jetty-security

HttpSession session = httpRequest.getSession(false);
if (session == null || session.getAttribute(SessionAuthentication.__J_AUTHENTICATED) == null)
  return; //not authenticated yet
  return; //didn't save original request method
StringBuffer buf = httpRequest.getRequestURL();
if (httpRequest.getQueryString() != null)
  buf.append("?").append(httpRequest.getQueryString());
if (LOG.isDebugEnabled()) LOG.debug("Restoring original method {} for {} with method {}", method, juri,httpRequest.getMethod());
Request base_request = Request.getBaseRequest(request);
base_request.setMethod(method);

代码示例来源:origin: jenkinsci/winstone

public void handleAsync(HttpChannel channel) throws IOException, ServletException
{
  final HttpChannelState state = channel.getRequest().getHttpChannelState();
  final AsyncContextEvent event = state.getAsyncContextEvent();
  final Request baseRequest=channel.getRequest();
  final String path=event.getPath();
  if (path!=null)
  {
    // this is a dispatch with a path
    ServletContext context=event.getServletContext();
    String query=baseRequest.getQueryString();
    baseRequest.setURIPathQuery(URIUtil.addEncodedPaths(context==null?null:URIUtil.encodePath(context.getContextPath()), path));
    HttpURI uri = baseRequest.getHttpURI();
    baseRequest.setPathInfo(uri.getDecodedPath());
    if (uri.getQuery()!=null)
      baseRequest.mergeQueryParameters(query,uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
  }
  final String target=baseRequest.getPathInfo();
  final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
  final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
  if (LOG.isDebugEnabled())
    LOG.debug("{} {} {} on {}", request.getDispatcherType(), request.getMethod(), target, channel);
  handle(target, baseRequest, request, response);
  if (LOG.isDebugEnabled())
    LOG.debug("handledAsync={} async={} committed={} on {}", channel.getRequest().isHandled(),request.isAsyncStarted(),response.isCommitted(),channel);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

public void handleAsync(HttpChannel connection) throws IOException, ServletException
{
  final HttpChannelState state = connection.getRequest().getHttpChannelState();
  final AsyncContextEvent event = state.getAsyncContextEvent();
  final Request baseRequest=connection.getRequest();
  final String path=event.getPath();
  if (path!=null)
  {
    // this is a dispatch with a path
    ServletContext context=event.getServletContext();
    String query=baseRequest.getQueryString();
    baseRequest.setURIPathQuery(URIUtil.addPaths(context==null?null:context.getContextPath(), path));
    HttpURI uri = baseRequest.getHttpURI();
    baseRequest.setPathInfo(uri.getDecodedPath());
    if (uri.getQuery()!=null)
      baseRequest.mergeQueryParameters(query,uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
  }
  final String target=baseRequest.getPathInfo();
  final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
  final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
  if (LOG.isDebugEnabled())
  {
    LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection);
    handle(target, baseRequest, request, response);
    LOG.debug("RESPONSE "+target+"  "+connection.getResponse().getStatus());
  }
  else
    handle(target, baseRequest, request, response);
}

代码示例来源:origin: Nextdoor/bender

public void handleAsync(HttpChannel<?> connection) throws IOException, ServletException
{
  final HttpChannelState state = connection.getRequest().getHttpChannelState();
  final AsyncContextEvent event = state.getAsyncContextEvent();
  final Request baseRequest=connection.getRequest();
  final String path=event.getPath();
  
  if (path!=null)
  {
    // this is a dispatch with a path
    ServletContext context=event.getServletContext();
    HttpURI uri = new HttpURI(URIUtil.addPaths(context==null?null:context.getContextPath(), path));            
    baseRequest.setUri(uri);
    baseRequest.setRequestURI(null);
    baseRequest.setPathInfo(uri.getDecodedPath());
    if (uri.getQuery()!=null)
      baseRequest.mergeQueryParameters(uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
  }
  final String target=baseRequest.getPathInfo();
  final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
  final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
  if (LOG.isDebugEnabled())
  {
    LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection);
    handle(target, baseRequest, request, response);
    LOG.debug("RESPONSE "+target+"  "+connection.getResponse().getStatus());
  }
  else
    handle(target, baseRequest, request, response);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public void handle(AbstractHttpConnection connection) throws IOException, ServletException
{
  final String target=connection.getRequest().getPathInfo();
  final Request request=connection.getRequest();
  final Response response=connection.getResponse();
  if (LOG.isDebugEnabled())
  {
    LOG.debug("REQUEST "+target+" on "+connection);
    handle(target, request, request, response);
    LOG.debug("RESPONSE "+target+"  "+connection.getResponse().getStatus()+" handled="+request.isHandled());
  }
  else
    handle(target, request, request, response);
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

if (context.isStarted())
  if (LOG.isDebugEnabled())
    LOG.debug("Cannot configure webapp "+context+" after it is started");
  return;
Resource web_inf = context.getWebInf();
if (web_inf != null && web_inf.isDirectory() && context.getClassLoader() instanceof WebAppClassLoader)
  Resource classes= web_inf.addPath("classes/");
  if (classes.exists())
    ((WebAppClassLoader)context.getClassLoader()).addClassPath(classes);

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

if (lib.exists() && lib.isDirectory())
  String[] files=lib.list();
  if (files != null)
      Resource fn=lib.addPath(files[f]);
      if(LOG.isDebugEnabled())
        LOG.debug("addJar - {}", fn);
      String fnlc=fn.getName().toLowerCase(Locale.ENGLISH);
      LOG.warn(Log.EXCEPTION,ex);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public void handleAsync(AbstractHttpConnection connection) throws IOException, ServletException
{
  final AsyncContinuation async = connection.getRequest().getAsyncContinuation();
  final AsyncContinuation.AsyncEventState state = async.getAsyncEventState();
  final Request baseRequest=connection.getRequest();
  final String path=state.getPath();
  if (path!=null)
  {
    // this is a dispatch with a path
    final String contextPath=state.getServletContext().getContextPath();
    HttpURI uri = new HttpURI(URIUtil.addPaths(contextPath,path));
    baseRequest.setUri(uri);
    baseRequest.setRequestURI(null);
    baseRequest.setPathInfo(baseRequest.getRequestURI());
    if (uri.getQuery()!=null)
      baseRequest.mergeQueryString(uri.getQuery()); //we have to assume dispatch path and query are UTF8
  }
  final String target=baseRequest.getPathInfo();
  final HttpServletRequest request=(HttpServletRequest)async.getRequest();
  final HttpServletResponse response=(HttpServletResponse)async.getResponse();
  if (LOG.isDebugEnabled())
  {
    LOG.debug("REQUEST "+target+" on "+connection);
    handle(target, baseRequest, request, response);
    LOG.debug("RESPONSE "+target+"  "+connection.getResponse().getStatus());
  }
  else
    handle(target, baseRequest, request, response);
}

代码示例来源:origin: i2p/i2p.i2p

if (_ignorePathMap != null && _ignorePathMap.getMatch(request.getRequestURI()) != null)
  return;
    buf.append(request.getServerName());
    buf.append(' ');
  if (_preferProxiedForAddress) 
    addr = request.getHeader("X-Forwarded-For");
  buf.append(request.getProtocol());
  buf.append("\" ");
  int status = response.getStatus();
  if (status<=0)
    status=404;
  long responseLength=response.getContentCount();
  if (responseLength == 0 && status == 200 && !"HEAD".equals(request.getMethod()))
    responseLength = response.getLongContentLength();
  if (responseLength >=0)
Log.getLogger((String)null).warn(e);

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

LOG.warn(new Throwable()); // TODO throw ISE?
LOG.info("NO JSP Support for {}, did not find {}", context.getContextPath(), servlet_class);
servlet_class = "org.eclipse.jetty.servlet.NoJspServlet";
  LOG.warn(new Throwable()); // TODO throw ISE?
LOG.warn("Deprecated boolean load-on-startup.  Please use integer");
order = 1;
  LOG.warn("Cannot parse load-on-startup " + s + ". Please use integer");
  LOG.ignore(e);
  LOG.warn(new Throwable()); // TODO throw ISE?
if (LOG.isDebugEnabled()) LOG.debug("link role " + roleName + " to " + roleLink + " for " + this);
switch (context.getMetaData().getOrigin(name+".servlet.role-name."+roleName))
    LOG.warn(new Throwable()); // TODO throw ISE?
LOG.warn("Ignored invalid security-role-ref element: " + "servlet-name=" + holder.getName() + ", " + securityRef);
    LOG.warn(new Throwable()); // TODO throw ISE?
  LOG.warn(new Throwable()); // TODO throw ISE?
  LOG.warn(new Throwable()); // TODO throw ISE?
  LOG.warn(new Throwable()); // TODO throw ISE?

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
{
  String descriptor = context.getDescriptor();
  if (descriptor != null)
  {
    Resource web = context.newResource(descriptor);
    if (web.exists() && !web.isDirectory()) return web;
  }
  Resource web_inf = context.getWebInf();
  if (web_inf != null && web_inf.isDirectory())
  {
    // do web.xml file
    Resource web = web_inf.addPath("web.xml");
    if (web.exists()) return web;
    if (LOG.isDebugEnabled())
      LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  }
  return null;
}

代码示例来源:origin: org.eclipse.jetty/jetty-webapp

if (tmp.isEmpty())
    if (LOG.isDebugEnabled()) LOG.debug(jar+" cached as containing no tlds");
    return;
    if (LOG.isDebugEnabled()) LOG.debug(jar+" tlds found in cache ");
  if (jar.isDirectory())
    tlds.addAll(getTlds(jar.getFile()));
    URI uri = jar.getURI();
    tlds.addAll(getTlds(uri));
    if (LOG.isDebugEnabled()) LOG.debug(jar+" tld cache updated");
    Collection<URL> old = (Collection<URL>)cache.putIfAbsent(jar, tlds);
    if (old != null)
Collection<URL> metaInfTlds = (Collection<URL>)context.getAttribute(METAINF_TLDS);
if (metaInfTlds == null)
  context.setAttribute(METAINF_TLDS, metaInfTlds);
if (LOG.isDebugEnabled()) LOG.debug("tlds added to context");

相关文章