org.mortbay.jetty.handler.RequestLogHandler Java Examples

The following examples show how to use org.mortbay.jetty.handler.RequestLogHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Jetty6PluginServer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Set up the handler structure to receive a webapp. Also put in a DefaultHandler so we get a nice page than a 404
 * if we hit the root and the webapp's context isn't at root.
 */
public void configureHandlers() throws Exception {
    this.defaultHandler = new DefaultHandler();
    this.requestLogHandler = new RequestLogHandler();
    if (this.requestLog != null) {
        this.requestLogHandler.setRequestLog(this.requestLog);
    }

    this.contexts = (ContextHandlerCollection) server.getChildHandlerByClass(ContextHandlerCollection.class);
    if (this.contexts == null) {
        this.contexts = new ContextHandlerCollection();
        this.handlers = (HandlerCollection) server.getChildHandlerByClass(HandlerCollection.class);
        if (this.handlers == null) {
            this.handlers = new HandlerCollection();
            this.server.setHandler(handlers);
            this.handlers.setHandlers(new Handler[]{this.contexts, this.defaultHandler, this.requestLogHandler});
        } else {
            this.handlers.addHandler(this.contexts);
        }
    }
}
 
Example #2
Source File: Jetty6PluginServer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Set up the handler structure to receive a webapp. Also put in a DefaultHandler so we get a nice page than a 404
 * if we hit the root and the webapp's context isn't at root.
 */
public void configureHandlers() throws Exception {
    this.defaultHandler = new DefaultHandler();
    this.requestLogHandler = new RequestLogHandler();
    if (this.requestLog != null) {
        this.requestLogHandler.setRequestLog(this.requestLog);
    }

    this.contexts = (ContextHandlerCollection) server.getChildHandlerByClass(ContextHandlerCollection.class);
    if (this.contexts == null) {
        this.contexts = new ContextHandlerCollection();
        this.handlers = (HandlerCollection) server.getChildHandlerByClass(HandlerCollection.class);
        if (this.handlers == null) {
            this.handlers = new HandlerCollection();
            this.server.setHandler(handlers);
            this.handlers.setHandlers(new Handler[]{this.contexts, this.defaultHandler, this.requestLogHandler});
        } else {
            this.handlers.addHandler(this.contexts);
        }
    }
}
 
Example #3
Source File: Jetty6PluginServer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Set up the handler structure to receive a webapp. Also put in a DefaultHandler so we get a nice page than a 404
 * if we hit the root and the webapp's context isn't at root.
 */
public void configureHandlers() throws Exception {
    this.defaultHandler = new DefaultHandler();
    this.requestLogHandler = new RequestLogHandler();
    if (this.requestLog != null) {
        this.requestLogHandler.setRequestLog(this.requestLog);
    }

    this.contexts = (ContextHandlerCollection) server.getChildHandlerByClass(ContextHandlerCollection.class);
    if (this.contexts == null) {
        this.contexts = new ContextHandlerCollection();
        this.handlers = (HandlerCollection) server.getChildHandlerByClass(HandlerCollection.class);
        if (this.handlers == null) {
            this.handlers = new HandlerCollection();
            this.server.setHandler(handlers);
            this.handlers.setHandlers(new Handler[]{this.contexts, this.defaultHandler, this.requestLogHandler});
        } else {
            this.handlers.addHandler(this.contexts);
        }
    }
}
 
Example #4
Source File: Jetty6PluginServer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Set up the handler structure to receive a webapp. Also put in a DefaultHandler so we get a nice page than a 404
 * if we hit the root and the webapp's context isn't at root.
 */
public void configureHandlers() throws Exception {
    this.defaultHandler = new DefaultHandler();
    this.requestLogHandler = new RequestLogHandler();
    if (this.requestLog != null) {
        this.requestLogHandler.setRequestLog(this.requestLog);
    }

    this.contexts = (ContextHandlerCollection) server.getChildHandlerByClass(ContextHandlerCollection.class);
    if (this.contexts == null) {
        this.contexts = new ContextHandlerCollection();
        this.handlers = (HandlerCollection) server.getChildHandlerByClass(HandlerCollection.class);
        if (this.handlers == null) {
            this.handlers = new HandlerCollection();
            this.server.setHandler(handlers);
            this.handlers.setHandlers(new Handler[]{this.contexts, this.defaultHandler, this.requestLogHandler});
        } else {
            this.handlers.addHandler(this.contexts);
        }
    }
}
 
Example #5
Source File: AbstractServerMojo.java    From opoopress with Apache License 2.0 5 votes vote down vote up
protected RequestLogHandler createRequestLogHandler(){
    boolean showRequestLog = Boolean.getBoolean("requestLog");
    if(!showRequestLog){
        return null;
    }

    NCSARequestLog requestLog = new NCSARequestLog();
    requestLog.setLogDateFormat(null);

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

    return logHandler;
}