[Minor] Updated restful logging
This commit is contained in:
parent
3edcec4d08
commit
4b78b30600
|
@ -204,14 +204,15 @@ public class RestfulStrolchComponent extends StrolchComponent {
|
|||
|
||||
@Override
|
||||
public void start() throws Exception {
|
||||
DBC.PRE.assertNull("Instance is already set! This component is a singleton resource!", instance);
|
||||
instance = this;
|
||||
if (instance == null)
|
||||
instance = this;
|
||||
else if (instance != this)
|
||||
throw new IllegalStateException("Instance is already set! This component is a singleton resource!");
|
||||
super.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() throws Exception {
|
||||
instance = null;
|
||||
super.stop();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.io.IOException;
|
|||
|
||||
import static li.strolch.rest.StrolchRestfulConstants.STROLCH_REMOTE_IP;
|
||||
import static li.strolch.rest.StrolchRestfulConstants.STROLCH_REQUEST_URL;
|
||||
import static li.strolch.rest.helper.ServletRequestHelper.logRequest;
|
||||
|
||||
@PreMatching
|
||||
public class LogRequestFilter implements ContainerRequestFilter {
|
||||
|
@ -31,5 +32,7 @@ public class LogRequestFilter implements ContainerRequestFilter {
|
|||
this.request.setAttribute(STROLCH_REMOTE_IP, remoteIp);
|
||||
this.request.setAttribute(STROLCH_REQUEST_URL,
|
||||
requestContext.getMethod() + " " + requestContext.getUriInfo().getRequestUri());
|
||||
|
||||
logRequest(this.request);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue