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

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

本文整理了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

  1. if (resourcesDir == EmptyResource.INSTANCE)
  2. if (LOG.isDebugEnabled()) LOG.debug(target+" cached as containing no META-INF/resources");
  3. return;
  4. if (LOG.isDebugEnabled()) LOG.debug(target+" META-INF/resources found in cache ");
  5. if (LOG.isDebugEnabled()) LOG.debug(target+" META-INF/resources checked");
  6. if (target.isDirectory())
  7. resourcesDir = target.addPath("/META-INF/resources");
  8. URI uri = target.getURI();
  9. resourcesDir = Resource.newResource(uriJarPrefix(uri,"!/META-INF/resources"));
  10. resourcesDir = old;
  11. else
  12. if (LOG.isDebugEnabled()) LOG.debug(target+" META-INF/resources cache updated");
  13. Set<Resource> dirs = (Set<Resource>)context.getAttribute(METAINF_RESOURCES);
  14. if (dirs == null)
  15. context.setAttribute(METAINF_RESOURCES, dirs);
  16. if (LOG.isDebugEnabled()) LOG.debug(resourcesDir+" added to context");

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

  1. if (context.isStarted())
  2. LOG.debug("Cannot configure webapp after it is started");
  3. return;
  4. LOG.debug("Configuring web-jetty.xml");
  5. Resource web_inf = context.getWebInf();
  6. if(web_inf!=null&&web_inf.isDirectory())
  7. Resource jetty=web_inf.addPath("jetty8-web.xml");
  8. if(!jetty.exists())
  9. jetty=web_inf.addPath(JETTY_WEB_XML);
  10. if(!jetty.exists())
  11. if(jetty.exists())
  12. if(LOG.isDebugEnabled())
  13. LOG.debug("Configure: "+jetty);
  14. Object xml_attr=context.getAttribute(XML_CONFIGURATION);
  15. context.removeAttribute(XML_CONFIGURATION);
  16. final XmlConfiguration jetty_config = xml_attr instanceof XmlConfiguration?(XmlConfiguration)xml_attr:new XmlConfiguration(jetty.getURI().toURL());
  17. LOG.warn("Error applying {}",jetty);
  18. throw e;

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

  1. private void dumpUrl()
  2. {
  3. Connector[] connectors = getServer().getConnectors();
  4. for (int i=0;i<connectors.length;i++)
  5. {
  6. String displayName = getDisplayName();
  7. if (displayName == null)
  8. displayName = "WebApp@"+Arrays.hashCode(connectors);
  9. LOG.info(displayName + " at http://" + connectors[i].toString() + getContextPath());
  10. }
  11. }

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

  1. @Override
  2. public boolean isSystemResource(String name, URL url)
  3. {
  4. if (_systemClasses == null)
  5. loadSystemClasses();
  6. boolean result = _systemClasses.match(name,url);
  7. if (LOG.isDebugEnabled())
  8. LOG.debug("isSystemResource=={} {} {}",result,name,url);
  9. return result;
  10. }

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

  1. @Override
  2. public boolean isServerClass(Class<?> clazz)
  3. {
  4. if (_serverClasses == null)
  5. loadServerClasses();
  6. boolean result = _serverClasses.match(clazz);
  7. if (LOG.isDebugEnabled())
  8. LOG.debug("isServerClass=={} {}",result,clazz);
  9. return result;
  10. }

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

  1. @Override
  2. public Class<?> loadClass(String name) throws ClassNotFoundException
  3. {
  4. if (_notFound.contains(name))
  5. {
  6. if (LOG.isDebugEnabled())
  7. LOG.debug("Not found cache hit resource {}",name);
  8. throw new ClassNotFoundException(name+": in notfound cache");
  9. }
  10. try
  11. {
  12. return super.loadClass(name);
  13. }
  14. catch (ClassNotFoundException nfe)
  15. {
  16. if (_notFound.add(name))
  17. if (LOG.isDebugEnabled())
  18. {
  19. LOG.debug("Caching not found {}",name);
  20. LOG.debug(nfe);
  21. }
  22. throw nfe;
  23. }
  24. }

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

  1. LOG.debug("jsecuritycheck {} {}",username,user);
  2. LOG.debug("authenticated {}->{}",form_auth,nuri);
  3. if (LOG.isDebugEnabled())
  4. LOG.debug("Form authentication FAILED for " + StringUtil.printable(username));
  5. if (_formErrorPage == null)
  6. LOG.debug("auth failed {}->403",username);
  7. if (response != null)
  8. response.sendError(HttpServletResponse.SC_FORBIDDEN);
  9. LOG.debug("auth failed {}=={}",username,_formErrorPage);
  10. LOG.debug("auth failed {}->{}",username,_formErrorPage);
  11. int redirectCode = (base_request.getHttpVersion().getVersion() < HttpVersion.HTTP_1_1.getVersion() ? HttpServletResponse.SC_MOVED_TEMPORARILY : HttpServletResponse.SC_SEE_OTHER);
  12. base_response.sendRedirect(redirectCode, response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),_formErrorPage)));
  13. LOG.debug("auth revoked {}",authentication);
  14. session.removeAttribute(SessionAuthentication.__J_AUTHENTICATED);
  15. LOG.debug("auth retry {}->{}",authentication,j_uri);
  16. LOG.debug("auth rePOST {}->{}",authentication,j_uri);
  17. LOG.debug("auth {}",authentication);
  18. return authentication;
  19. LOG.debug("auth deferred {}",session == null ? null : session.getId());

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

  1. @Override
  2. public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
  3. {
  4. if (HttpMethods.CONNECT.equalsIgnoreCase(request.getMethod()))
  5. {
  6. LOG.debug("CONNECT request for {}", request.getRequestURI());
  7. try
  8. {
  9. handleConnect(baseRequest, request, response, request.getRequestURI());
  10. }
  11. catch(Exception e)
  12. {
  13. LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e);
  14. LOG.debug(e);
  15. }
  16. }
  17. else
  18. {
  19. super.handle(target, baseRequest, request, response);
  20. }
  21. }

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

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

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

  1. public void handleAsync(HttpChannel channel) throws IOException, ServletException
  2. {
  3. final HttpChannelState state = channel.getRequest().getHttpChannelState();
  4. final AsyncContextEvent event = state.getAsyncContextEvent();
  5. final Request baseRequest=channel.getRequest();
  6. final String path=event.getPath();
  7. if (path!=null)
  8. {
  9. // this is a dispatch with a path
  10. ServletContext context=event.getServletContext();
  11. String query=baseRequest.getQueryString();
  12. baseRequest.setURIPathQuery(URIUtil.addEncodedPaths(context==null?null:URIUtil.encodePath(context.getContextPath()), path));
  13. HttpURI uri = baseRequest.getHttpURI();
  14. baseRequest.setPathInfo(uri.getDecodedPath());
  15. if (uri.getQuery()!=null)
  16. baseRequest.mergeQueryParameters(query,uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
  17. }
  18. final String target=baseRequest.getPathInfo();
  19. final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
  20. final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
  21. if (LOG.isDebugEnabled())
  22. LOG.debug("{} {} {} on {}", request.getDispatcherType(), request.getMethod(), target, channel);
  23. handle(target, baseRequest, request, response);
  24. if (LOG.isDebugEnabled())
  25. LOG.debug("handledAsync={} async={} committed={} on {}", channel.getRequest().isHandled(),request.isAsyncStarted(),response.isCommitted(),channel);
  26. }

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

  1. public void handleAsync(HttpChannel connection) throws IOException, ServletException
  2. {
  3. final HttpChannelState state = connection.getRequest().getHttpChannelState();
  4. final AsyncContextEvent event = state.getAsyncContextEvent();
  5. final Request baseRequest=connection.getRequest();
  6. final String path=event.getPath();
  7. if (path!=null)
  8. {
  9. // this is a dispatch with a path
  10. ServletContext context=event.getServletContext();
  11. String query=baseRequest.getQueryString();
  12. baseRequest.setURIPathQuery(URIUtil.addPaths(context==null?null:context.getContextPath(), path));
  13. HttpURI uri = baseRequest.getHttpURI();
  14. baseRequest.setPathInfo(uri.getDecodedPath());
  15. if (uri.getQuery()!=null)
  16. baseRequest.mergeQueryParameters(query,uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
  17. }
  18. final String target=baseRequest.getPathInfo();
  19. final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
  20. final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
  21. if (LOG.isDebugEnabled())
  22. {
  23. LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection);
  24. handle(target, baseRequest, request, response);
  25. LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
  26. }
  27. else
  28. handle(target, baseRequest, request, response);
  29. }

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

  1. public void handleAsync(HttpChannel<?> connection) throws IOException, ServletException
  2. {
  3. final HttpChannelState state = connection.getRequest().getHttpChannelState();
  4. final AsyncContextEvent event = state.getAsyncContextEvent();
  5. final Request baseRequest=connection.getRequest();
  6. final String path=event.getPath();
  7. if (path!=null)
  8. {
  9. // this is a dispatch with a path
  10. ServletContext context=event.getServletContext();
  11. HttpURI uri = new HttpURI(URIUtil.addPaths(context==null?null:context.getContextPath(), path));
  12. baseRequest.setUri(uri);
  13. baseRequest.setRequestURI(null);
  14. baseRequest.setPathInfo(uri.getDecodedPath());
  15. if (uri.getQuery()!=null)
  16. baseRequest.mergeQueryParameters(uri.getQuery(), true); //we have to assume dispatch path and query are UTF8
  17. }
  18. final String target=baseRequest.getPathInfo();
  19. final HttpServletRequest request=(HttpServletRequest)event.getSuppliedRequest();
  20. final HttpServletResponse response=(HttpServletResponse)event.getSuppliedResponse();
  21. if (LOG.isDebugEnabled())
  22. {
  23. LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection);
  24. handle(target, baseRequest, request, response);
  25. LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
  26. }
  27. else
  28. handle(target, baseRequest, request, response);
  29. }

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

  1. public void handle(AbstractHttpConnection connection) throws IOException, ServletException
  2. {
  3. final String target=connection.getRequest().getPathInfo();
  4. final Request request=connection.getRequest();
  5. final Response response=connection.getResponse();
  6. if (LOG.isDebugEnabled())
  7. {
  8. LOG.debug("REQUEST "+target+" on "+connection);
  9. handle(target, request, request, response);
  10. LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled());
  11. }
  12. else
  13. handle(target, request, request, response);
  14. }

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

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

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

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

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

  1. public void handleAsync(AbstractHttpConnection connection) throws IOException, ServletException
  2. {
  3. final AsyncContinuation async = connection.getRequest().getAsyncContinuation();
  4. final AsyncContinuation.AsyncEventState state = async.getAsyncEventState();
  5. final Request baseRequest=connection.getRequest();
  6. final String path=state.getPath();
  7. if (path!=null)
  8. {
  9. // this is a dispatch with a path
  10. final String contextPath=state.getServletContext().getContextPath();
  11. HttpURI uri = new HttpURI(URIUtil.addPaths(contextPath,path));
  12. baseRequest.setUri(uri);
  13. baseRequest.setRequestURI(null);
  14. baseRequest.setPathInfo(baseRequest.getRequestURI());
  15. if (uri.getQuery()!=null)
  16. baseRequest.mergeQueryString(uri.getQuery()); //we have to assume dispatch path and query are UTF8
  17. }
  18. final String target=baseRequest.getPathInfo();
  19. final HttpServletRequest request=(HttpServletRequest)async.getRequest();
  20. final HttpServletResponse response=(HttpServletResponse)async.getResponse();
  21. if (LOG.isDebugEnabled())
  22. {
  23. LOG.debug("REQUEST "+target+" on "+connection);
  24. handle(target, baseRequest, request, response);
  25. LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus());
  26. }
  27. else
  28. handle(target, baseRequest, request, response);
  29. }

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

  1. if (_ignorePathMap != null && _ignorePathMap.getMatch(request.getRequestURI()) != null)
  2. return;
  3. buf.append(request.getServerName());
  4. buf.append(' ');
  5. if (_preferProxiedForAddress)
  6. addr = request.getHeader("X-Forwarded-For");
  7. buf.append(request.getProtocol());
  8. buf.append("\" ");
  9. int status = response.getStatus();
  10. if (status<=0)
  11. status=404;
  12. long responseLength=response.getContentCount();
  13. if (responseLength == 0 && status == 200 && !"HEAD".equals(request.getMethod()))
  14. responseLength = response.getLongContentLength();
  15. if (responseLength >=0)
  16. Log.getLogger((String)null).warn(e);

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

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

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

  1. protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException
  2. {
  3. String descriptor = context.getDescriptor();
  4. if (descriptor != null)
  5. {
  6. Resource web = context.newResource(descriptor);
  7. if (web.exists() && !web.isDirectory()) return web;
  8. }
  9. Resource web_inf = context.getWebInf();
  10. if (web_inf != null && web_inf.isDirectory())
  11. {
  12. // do web.xml file
  13. Resource web = web_inf.addPath("web.xml");
  14. if (web.exists()) return web;
  15. if (LOG.isDebugEnabled())
  16. LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
  17. }
  18. return null;
  19. }

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

  1. if (tmp.isEmpty())
  2. if (LOG.isDebugEnabled()) LOG.debug(jar+" cached as containing no tlds");
  3. return;
  4. if (LOG.isDebugEnabled()) LOG.debug(jar+" tlds found in cache ");
  5. if (jar.isDirectory())
  6. tlds.addAll(getTlds(jar.getFile()));
  7. URI uri = jar.getURI();
  8. tlds.addAll(getTlds(uri));
  9. if (LOG.isDebugEnabled()) LOG.debug(jar+" tld cache updated");
  10. Collection<URL> old = (Collection<URL>)cache.putIfAbsent(jar, tlds);
  11. if (old != null)
  12. Collection<URL> metaInfTlds = (Collection<URL>)context.getAttribute(METAINF_TLDS);
  13. if (metaInfTlds == null)
  14. context.setAttribute(METAINF_TLDS, metaInfTlds);
  15. if (LOG.isDebugEnabled()) LOG.debug("tlds added to context");

相关文章