19
19
import java .net .URI ;
20
20
import java .net .URISyntaxException ;
21
21
import java .util .Properties ;
22
- import java .util .logging .Level ;
23
- import java .util .logging .Logger ;
24
22
import javax .servlet .ServletConfig ;
25
23
import javax .servlet .ServletException ;
26
24
import javax .servlet .annotation .WebInitParam ;
27
25
import javax .servlet .annotation .WebServlet ;
28
26
import javax .servlet .http .HttpServletRequest ;
29
27
import org .apache .http .HttpRequest ;
28
+ import org .slf4j .Logger ;
29
+ import org .slf4j .LoggerFactory ;
30
30
import org .usergrid .java .client .Client ;
31
31
32
32
/**
41
41
})
42
42
@ SuppressWarnings ("serial" )
43
43
public class UserGridProxyServlet extends ProxyServlet {
44
-
45
- protected static final Logger log = Logger .getLogger (ProxyServlet .class .getName ());
44
+ private Logger log = LoggerFactory .getLogger (RoutingFilter .class );
46
45
private Client userGridClient ;
47
46
private String applicationName ;
48
47
@@ -60,9 +59,9 @@ public void init(ServletConfig servletConfig) throws ServletException {
60
59
try {
61
60
targetUri = new URI ((String ) properties .get ("app.usergridUri" ));
62
61
} catch (NullPointerException ex ) {
63
- log .log ( Level . INFO , "app.usergridUri not specified, using " + targetUri );
62
+ log .info ( "app.usergridUri not specified, using " + targetUri );
64
63
} catch (URISyntaxException ex ) {
65
- log .log ( Level . INFO , "Ignoring app.usergridUri because it is invalid." );
64
+ log .info ( "Ignoring app.usergridUri because it is invalid." );
66
65
}
67
66
68
67
applicationName = (String ) properties .get ("app.applicationName" );
@@ -75,7 +74,7 @@ public void init(ServletConfig servletConfig) throws ServletException {
75
74
userGridClient .authorizeAppClient (clientId , clientSecret );
76
75
77
76
} catch (IOException ex ) {
78
- log .log ( Level . SEVERE , "Unable to load app.properties and authorize the client" , ex );
77
+ log .info ( "Unable to load app.properties and authorize the client" , ex );
79
78
}
80
79
}
81
80
@@ -95,7 +94,7 @@ protected void copyRequestHeaders(HttpServletRequest req, HttpRequest proxyReq)
95
94
96
95
String header = "Bearer " + userGridClient .getAccessToken ();
97
96
proxyReq .setHeader ("Authorization" , header );
98
- log .log ( Level . FINEST , "Added header = {0}" , header );
97
+ log .info ( "Added header = {0}" , header );
99
98
}
100
99
}
101
100
}
0 commit comments