Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.NCSARequestLog


    EnumSet<DispatcherType> types = EnumSet.allOf(DispatcherType.class);
    servletContextHandler.addFilter(filterHolder, "/*", types);
   
    HandlerCollection handlers = new HandlerCollection();
    final RequestLogHandler requestLogHandler = new RequestLogHandler();
    NCSARequestLog requestLog = new NCSARequestLog();
    requestLog.setAppend(true);
    requestLog.setExtended(true);
    requestLog.setLogLatency(true);
    requestLogHandler.setRequestLog(requestLog);
    handlers.setHandlers(new Handler[] {servletContextHandler, requestLogHandler});
    server.setHandler(handlers);
   
 
View Full Code Here


    return handlers;
  }
 
  private RequestLogHandler buildRequestLog() {
    final RequestLogHandler handler = new RequestLogHandler();
    final NCSARequestLog log = new NCSARequestLog();
    configuration.configureRequestLog(log);
    handler.setRequestLog(log);
    return handler;
  }
View Full Code Here

        Handler dft = new DefaultHandler();
        RequestLogHandler requestLog = new RequestLogHandler();

        // configure request logging
        File requestLogFile = File.createTempFile("demo", "log");
        NCSARequestLog ncsaLog = new NCSARequestLog(
                requestLogFile.getAbsolutePath());
        requestLog.setRequestLog(ncsaLog);

        // create the handler collections
        HandlerCollection handlers = new HandlerCollection();
View Full Code Here

        login.setName("Test Realm");
        login.setConfig(jetty_root + "/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/etc/realm.properties");
        server.addBean(login);

        File log=File.createTempFile("jetty-yyyy_mm_dd", "log");
        NCSARequestLog requestLog = new NCSARequestLog(log.toString());
        requestLog.setExtended(false);
        requestLogHandler.setRequestLog(requestLog);

        server.setStopAtShutdown(true);

        WebAppContext webapp = new WebAppContext();
View Full Code Here

        stats.setHandler(server.getHandler());
        server.setHandler(stats);


        // === jetty-requestlog.xml ===
        NCSARequestLog requestLog = new NCSARequestLog();
        requestLog.setFilename(jetty_home + "/logs/yyyy_mm_dd.request.log");
        requestLog.setFilenameDateFormat("yyyy_MM_dd");
        requestLog.setRetainDays(90);
        requestLog.setAppend(true);
        requestLog.setExtended(true);
        requestLog.setLogCookies(false);
        requestLog.setLogTimeZone("GMT");
        RequestLogHandler requestLogHandler = new RequestLogHandler();
        requestLogHandler.setRequestLog(requestLog);
        handlers.addHandler(requestLogHandler);

View Full Code Here

        HashLoginService login = new HashLoginService();
        login.setName("Test Realm");
        login.setConfig(jetty_home + "/etc/realm.properties");
        server.addBean(login);

        NCSARequestLog requestLog = new AsyncNCSARequestLog();
        requestLog.setFilename(jetty_home + "/logs/jetty-yyyy_mm_dd.log");
        requestLog.setExtended(false);
        requestLogHandler.setRequestLog(requestLog);

        server.setStopAtShutdown(true);

        server.start();
View Full Code Here

          Logger logger = LoggerFactory.getLogger("org.eclipse.orion.server.config"); //$NON-NLS-1$
          logger.error("Could not initialize NCSA Request Log: Logs folder does not exist: " + logsFolder.toString()); //$NON-NLS-1$
        }
      }

      NCSARequestLog requestLog = new NCSARequestLog(logsFolder.toString() + File.separator + "orion-access-yyyy_mm_dd.log");
      requestLog.setRetainDays(90);
      requestLog.setAppend(true);
      requestLog.setExtended(true);
      requestLog.setLogTimeZone("EST");

      RequestLogHandler requestLogHandler = new RequestLogHandler();
      requestLogHandler.setRequestLog(requestLog);

      jettyContext.setHandler(requestLogHandler);
View Full Code Here

    context.setSecurityHandler(securityHandler);
  }
 
  @Override
  protected void configureRequestLog(RequestLog log) {
    final NCSARequestLog requestLog = (NCSARequestLog) log;
    requestLog.setIgnorePaths(new String[] { "/health/", "/stats/*" });
    requestLog.setLogLatency(true);
  }
View Full Code Here

    setStage(Stage.PRODUCTION);
  }
 
  @Override
  protected void configureRequestLog(RequestLog log) {
    final NCSARequestLog ncsaLog = (NCSARequestLog) log;
    ncsaLog.setExtended(false);
    ncsaLog.setLogLatency(true);
  }
View Full Code Here

        // handler2
        DefaultHandler defaultHandler = new DefaultHandler();

        // handler3
        RequestLogHandler requestLogHandler = new RequestLogHandler();
        NCSARequestLog requestLog = new NCSARequestLog();

        requestLog.setLogServer(true);
        requestLog.setLogLocale(Locale.ENGLISH);
        requestLogHandler.setRequestLog(requestLog);

        handlers.setHandlers(new Handler[] { contexts, defaultHandler, requestLogHandler });

        return handlers;
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.NCSARequestLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.