Project

General

Profile

« Previous | Next » 

Revision 10369

Added by Chris Jones over 6 years ago

Convert System.out.println() calls

We've had these calls printing to the log on every REST call. Change them to a logger debug() level so we can filter them out.

View differences:

src/edu/ucsb/nceas/metacat/restservice/D1HttpRequest.java
55 55
    public String getPathInfo() 
56 56
    {
57 57
        String s = super.getPathInfo();
58
        System.out.println("original pathInfo: " + s);
58
        logMetacat.debug("original pathInfo: " + s);
59 59
        logMetacat.info("D1HttpRequest.getPathInfo - the orignial pathInfo: "+s);
60 60
        String reqUri = this.getRequestURI();
61
        System.out.println("original requestURI: " + reqUri);
61
        logMetacat.debug("original requestURI: " + reqUri);
62 62
        String strip = this.getContextPath() + this.getServletPath();
63
        System.out.println("stripping " + strip + " from requestURI");
63
        logMetacat.debug("stripping " + strip + " from requestURI");
64 64
        s = reqUri.substring(strip.length());
65 65
        /*try
66 66
        {
......
70 70
        {
71 71
            s = URLDecoder.decode(s);
72 72
        }*/
73
        System.out.println("new pathinfo: " + s);
73
        logMetacat.debug("new pathinfo: " + s);
74 74
        logMetacat.info("D1HttpRequest.getPathInfo - the new pathInfo: "+s);
75 75
        return s;
76 76
    }
src/edu/ucsb/nceas/metacat/restservice/D1URLFilter.java
23 23

  
24 24
package edu.ucsb.nceas.metacat.restservice;
25 25

  
26
import javax.servlet.*;
27
import java.io.*;
28 26

  
27
import org.apache.commons.logging.Log;
28
import org.apache.commons.logging.LogFactory;
29

  
30
import java.io.IOException;
31

  
32
import javax.servlet.Filter;
33
import javax.servlet.FilterChain;
34
import javax.servlet.FilterConfig;
35
import javax.servlet.ServletContext;
36
import javax.servlet.ServletException;
37
import javax.servlet.ServletRequest;
38
import javax.servlet.ServletResponse;
39

  
40

  
29 41
/**
30 42
 * @author berkley
31 43
 *
......
33 45
public class D1URLFilter implements Filter
34 46
{
35 47
    ServletContext context;
48
    private static Log logger = LogFactory.getLog(D1URLFilter.class);
36 49
    
37 50
    public void init(FilterConfig filterConfig) 
38 51
    {
39
        System.out.println("D1URLFilter init.");
52
        logger.debug("D1URLFilter init.");
40 53
        this.context = filterConfig.getServletContext();
41 54
    }
42 55
    
43 56
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 
44 57
        throws IOException, ServletException 
45 58
    {
46
        System.out.println("In D1URLFilter.");
59
        logger.debug("In D1URLFilter.");
47 60
        D1HttpRequest d1h = new D1HttpRequest(request);
48 61
        chain.doFilter(d1h, response);
49 62
    }
50 63
    
51 64
    public void destroy() 
52 65
    {
53
        System.out.println("D1URLFilter destroy.");
66
        logger.debug("D1URLFilter destroy.");
54 67
    }
55 68
}

Also available in: Unified diff