Package org.mortbay.jetty

Examples of org.mortbay.jetty.NCSARequestLog


                "derby.stream.error.file",
                new File(log, "derby.log").getPath());
    }

    private void prepareAccessLog(File log) {
        NCSARequestLog ncsa = new NCSARequestLog(
                new File(log, "access.log.yyyy_mm_dd").getPath());
        ncsa.setFilenameDateFormat("yyyy-MM-dd");
        accessLog.setRequestLog(ncsa);
    }
View Full Code Here


            } else if ("request-log".equals(props.value)) {

                RequestLogHandler requestLogHandler = new RequestLogHandler();

                NCSARequestLog requestLog = new NCSARequestLog();

                if (props.getProperty("filename") != null) {
                    requestLog.setFilename(props.getProperty("filename").value);
                }

                if (props.getProperty("append") != null) {
                    requestLog.setAppend("true".equalsIgnoreCase(props.getProperty("append").value));
                }

                if (props.getProperty("extended") != null) {
                    requestLog.setExtended("true".equalsIgnoreCase(props.getProperty("extended").value));
                }

                if (props.getProperty("timezone") != null) {
                    requestLog.setLogTimeZone(props.getProperty("timezone").value);
                }

                if (props.getProperty("date-format") != null) {
                    requestLog.setLogDateFormat(props.getProperty("date-format").value);
                }

                if (props.getProperty("retain-days") != null) {
                    int days = 90;
                    try {
                        days = Integer.parseInt(props.getProperty("retain-days").value);
                    } catch (NumberFormatException e) {
                        days = 90;
                    }
                    requestLog.setRetainDays(days);
                }

                requestLogHandler.setRequestLog(requestLog);
                server.addHandler(requestLogHandler);
            }
View Full Code Here

        // handlers.addHandler(new DefaultHandler());

        // TODO use properties to set up
        final RequestLogHandler requestLogHandler = new RequestLogHandler();
        handlers.addHandler(requestLogHandler);
        final NCSARequestLog requestLog = new NCSARequestLog("./logs/jetty-yyyy_mm_dd.request.log");
        requestLog.setRetainDays(90);
        requestLog.setAppend(true);
        requestLog.setExtended(false);
        requestLog.setLogTimeZone("GMT");
        requestLogHandler.setRequestLog(requestLog);

        return handlers;
    }
View Full Code Here

        userRealm.setName("Test Realm");
        userRealm.setConfig(dir.getAbsolutePath()+"/etc/realm.properties");
        server.setUserRealms(new UserRealm[]{userRealm});
       
  File file = File.createTempFile("test",".log");
        NCSARequestLog requestLog = new NCSARequestLog(file.getAbsolutePath());
       
        requestLog.setExtended(false);
        requestLogHandler.setRequestLog(requestLog);
       
        server.setSendServerVersion(true);
       
        server.start();
View Full Code Here

        HashUserRealm userRealm = new HashUserRealm();
        userRealm.setName("Test Realm");
        userRealm.setConfig(jetty_home+"/etc/realm.properties");
        server.setUserRealms(new UserRealm[]{userRealm});
       
        NCSARequestLog requestLog = new NCSARequestLog(jetty_home+"/logs/jetty-yyyy_mm_dd.log");
        requestLog.setExtended(false);
        requestLogHandler.setRequestLog(requestLog);
       
        server.setStopAtShutdown(true);
        server.setSendServerVersion(true);
       
View Full Code Here

            } else if ("request-log".equals(props.value)) {

                RequestLogHandler requestLogHandler = new RequestLogHandler();

                NCSARequestLog requestLog = new NCSARequestLog();

                if (props.getProperty("filename") != null) {
                    requestLog.setFilename(props.getProperty("filename").value);
                }

                if (props.getProperty("append") != null) {
                    requestLog.setAppend("true".equalsIgnoreCase(props.getProperty("append").value));
                }

                if (props.getProperty("extended") != null) {
                    requestLog.setExtended("true".equalsIgnoreCase(props.getProperty("extended").value));
                }

                if (props.getProperty("timezone") != null) {
                    requestLog.setLogTimeZone(props.getProperty("timezone").value);
                }

                if (props.getProperty("date-format") != null) {
                    requestLog.setLogDateFormat(props.getProperty("date-format").value);
                }

                if (props.getProperty("retain-days") != null) {
                    int days = 90;
                    try {
                        days = Integer.parseInt(props.getProperty("retain-days").value);
                    } catch (NumberFormatException e) {
                        days = 90;
                    }
                    requestLog.setRetainDays(days);
                }

                requestLogHandler.setRequestLog(requestLog);
                server.addHandler(requestLogHandler);
            }
View Full Code Here

                "derby.stream.error.file",
                new File(log, "derby.log").getPath());
    }

    private void prepareAccessLog(File log) {
        NCSARequestLog ncsa = new NCSARequestLog(
                new File(log, "access.log.yyyy_mm_dd").getPath());
        ncsa.setFilenameDateFormat("yyyy-MM-dd");
        accessLog.setRequestLog(ncsa);
    }
View Full Code Here

        HashUserRealm userRealm = new HashUserRealm();
        userRealm.setName("Test Realm");
        userRealm.setConfig(jetty_home+"/etc/realm.properties");
        server.setUserRealms(new UserRealm[]{userRealm});
       
        NCSARequestLog requestLog = new NCSARequestLog(jetty_home+"/logs/jetty-yyyy_mm_dd.log");
        requestLog.setExtended(false);
        requestLogHandler.setRequestLog(requestLog);
       
        server.setStopAtShutdown(true);
        server.setSendServerVersion(true);
       
View Full Code Here

        userRealm.setName("Test Realm");
        userRealm.setConfig(dir.getAbsolutePath()+"/etc/realm.properties");
        server.setUserRealms(new UserRealm[]{userRealm});
       
  File file = File.createTempFile("test",".log");
        NCSARequestLog requestLog = new NCSARequestLog(file.getAbsolutePath());
       
        requestLog.setExtended(false);
        requestLogHandler.setRequestLog(requestLog);
       
        server.setSendServerVersion(true);
       
        server.start();
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.mortbay.jetty.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.