Log.getLog().setDebugEnabled(false);
Log.getLog().setDebugEnabled(false);
public static void compose(Server server) { //Servlets + Guice ServletContextHandler servletContextHandler = new ServletContextHandler(server, "/", ServletContextHandler.SESSIONS); servletContextHandler.addFilter(GuiceFilter.class, "/*", EnumSet.allOf(DispatcherType.class)); servletContextHandler.addServlet(DefaultServlet.class, "/"); //JMX stuff... MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer()); server.addEventListener(mbContainer); server.addBean(mbContainer); server.addBean(Log.getLog()); } }
private void behave(HttpServletRequest req, HttpServletResponse resp) throws ServletException { Log.getLog().debug("behaving: " + req.getPathInfo() + ", " + Arrays.toString(behaviour)); try { Map<Object, Object> ctx = new HashMap<Object, Object>(); for (Behaviour b : behaviour) { if (!b.execute(req, resp, ctx)) { break; } } } catch (Exception e) { throw new ServletException(e.getMessage(), e); } }
protected void setupJettyLogging() { if ((Log.getLog() instanceof JettyLogger) == false) { Log.setLog(new JettyLogger()); } }
protected void doStart() throws Exception { Log.getLog().info("Starting Bitronix Transaction Manager"); TransactionManagerServices.getTransactionManager(); }
/** * Notify the URL just once. Use best effort. */ protected boolean notifyURLOnce() { boolean success = false; try { Log.getLog().info("Job end notification trying " + urlToNotify); HttpURLConnection conn = (HttpURLConnection) urlToNotify.openConnection(proxyToUse); conn.setConnectTimeout(timeout); conn.setReadTimeout(timeout); conn.setAllowUserInteraction(false); if(conn.getResponseCode() != HttpURLConnection.HTTP_OK) { Log.getLog().warn("Job end notification to " + urlToNotify + " failed with code: " + conn.getResponseCode() + " and message \"" + conn.getResponseMessage() + "\""); } else { success = true; Log.getLog().info("Job end notification to " + urlToNotify + " succeeded"); } } catch(IOException ioe) { Log.getLog().warn("Job end notification to " + urlToNotify + " failed", ioe); } return success; }
public boolean execute( HttpServletRequest request, HttpServletResponse response, Map<Object, Object> ctx ) throws Exception { String headers = ""; @SuppressWarnings( "unchecked" ) Enumeration<String> names = request.getHeaderNames(); while ( names.hasMoreElements() ) { String name = names.nextElement(); String value = request.getHeader( name ); headers += name + ": " + value + "\n"; } Log.getLog().debug( headers ); String authHeader = request.getHeader( "Proxy-Authorization" ); if ( authHeader == null ) { response.setContentType( "text/html" ); response.addHeader( "Proxy-Authenticate", "BASIC realm=\"Test Proxy\"" ); response.sendError( 407, "proxy auth required" ); challenged = true; return false; } else { String expected = new String( B64Code.encode( ( user + ":" + password ).getBytes( "UTF-8" ) ) ); this.authorized = expected.equals( authHeader.split( " ", 2 )[1] ); } return this.authorized; }
proxyToUse = new Proxy(proxyType, new InetSocketAddress(hostname, port)); Log.getLog().info("Job end notification using proxy type \"" + proxyType + "\" hostname \"" + hostname + "\" and port \"" + port + "\""); } catch(NumberFormatException nfe) { Log.getLog().warn("Job end notification couldn't parse configured" + "proxy's port " + portConf + ". Not going to use a proxy");
Log.getLog().debug( request.getMethod() + " " + path );
protected void doStop() throws Exception { Log.getLog().info("Shutting down Bitronix Transaction Manager"); TransactionManagerServices.getTransactionManager().shutdown(); }
@Override public void start() { server = new Server(); server.setHandler(handler.getHandler()); for (ConnectorConfig config : connectors) { server.addConnector(config.getConnector(server)); } if (mbeanServer != null) { MBeanContainer mbContainer = new MBeanContainer(mbeanServer); server.addBean(mbContainer); server.addBean(Log.getLog()); } try { server.start(); printPorts(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
urlToNotify = new URL(userUrl); } catch (MalformedURLException mue) { Log.getLog().warn("Job end notification couldn't parse " + userUrl, mue); return; Log.getLog().info("Job end notification attempts left " + numTries); success = notifyURLOnce(); if (!success) { Log.getLog().warn("Job end notification failed to notify : " + urlToNotify); } else { Log.getLog().info("Job end notification succeeded for " + jobReport.getJobId());
public NodeHeartbeatResponse nodeHeartbeat(ApplicationAttemptId attemptId, long containerId, ContainerState containerState) throws Exception { ContainerStatus containerStatus = BuilderUtils.newContainerStatus( BuilderUtils.newContainerId(attemptId, containerId), containerState, "Success", 0, capability); ArrayList<ContainerStatus> containerStatusList = new ArrayList<ContainerStatus>(1); containerStatusList.add(containerStatus); Log.getLog().info("ContainerStatus: " + containerStatus); return nodeHeartbeat(containerStatusList, Collections.<Container>emptyList(), true, responseId); }
server.getContainer().addEventListener(mbContainer); server.addBean(mbContainer); mbContainer.addBean(Log.getLog());
server.addEventListener(mbContainer); server.addBean(mbContainer); server.addBean(Log.getLog());
Log.getLog().setDebugEnabled(false);
Log.getLog().setDebugEnabled(false);