Revision 10369
Added by Chris Jones almost 7 years ago
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
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.