org.apache.tomcat.util.log.SystemLogHandler Java Examples

The following examples show how to use org.apache.tomcat.util.log.SystemLogHandler. 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: ApplicationFilterConfig.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
private void initFilter() throws ServletException {
    if (context instanceof StandardContext &&
            context.getSwallowOutput()) {
        try {
            SystemLogHandler.startCapture();
            filter.init(this);
        } finally {
            String capturedlog = SystemLogHandler.stopCapture();
            if (capturedlog != null && capturedlog.length() > 0) {
                getServletContext().log(capturedlog);
            }
        }
    } else {
        filter.init(this);
    }

    // Expose filter via JMX
    registerJMX();
}
 
Example #2
Source File: ApplicationFilterConfig.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
private void initFilter() throws ServletException {
    if (context instanceof StandardContext &&
            context.getSwallowOutput()) {
        try {
            SystemLogHandler.startCapture();
            filter.init(this);
        } finally {
            String capturedlog = SystemLogHandler.stopCapture();
            if (capturedlog != null && capturedlog.length() > 0) {
                getServletContext().log(capturedlog);
            }
        }
    } else {
        filter.init(this);
    }
    
    // Expose filter via JMX
    registerJMX();
}
 
Example #3
Source File: ApplicationFilterConfig.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
private void initFilter() throws ServletException {
    if (context instanceof StandardContext &&
            context.getSwallowOutput()) {
        try {
            SystemLogHandler.startCapture();
            filter.init(this);
        } finally {
            String capturedlog = SystemLogHandler.stopCapture();
            if (capturedlog != null && capturedlog.length() > 0) {
                getServletContext().log(capturedlog);
            }
        }
    } else {
        filter.init(this);
    }
    
    // Expose filter via JMX
    registerJMX();
}
 
Example #4
Source File: Embedded.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
protected void initStreams() {
    if (redirectStreams) {
        // Replace System.out and System.err with a custom PrintStream
        System.setOut(new SystemLogHandler(System.out));
        System.setErr(new SystemLogHandler(System.err));
    }
}
 
Example #5
Source File: Embedded.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
protected void initStreams() {
    if (redirectStreams) {
        // Replace System.out and System.err with a custom PrintStream
        System.setOut(new SystemLogHandler(System.out));
        System.setErr(new SystemLogHandler(System.err));
    }
}
 
Example #6
Source File: Catalina.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
protected void initStreams() {
    // Replace System.out and System.err with a custom PrintStream
    System.setOut(new SystemLogHandler(System.out));
    System.setErr(new SystemLogHandler(System.err));
}
 
Example #7
Source File: Catalina.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
protected void initStreams() {
    // Replace System.out and System.err with a custom PrintStream
    System.setOut(new SystemLogHandler(System.out));
    System.setErr(new SystemLogHandler(System.err));
}
 
Example #8
Source File: Catalina.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
protected void initStreams() {
    // Replace System.out and System.err with a custom PrintStream
    System.setOut(new SystemLogHandler(System.out));
    System.setErr(new SystemLogHandler(System.err));
}