make request logs machine-readable

This commit is contained in:
xvrl 2013-03-06 22:30:07 -08:00
parent 552b365194
commit 21d648cc39
2 changed files with 4 additions and 4 deletions

View File

@ -93,7 +93,7 @@ public class QueryServlet extends HttpServlet
query = objectMapper.readValue(requestQuery, Query.class);
requestLogger.log(
new RequestLogLine(new DateTime(), req.getRemoteAddr(), query)
new RequestLogLine(new DateTime(), req.getRemoteAddr(), jsonMapper.writer().writeValueAsString(query))
);
Sequence<?> results = query.run(texasRanger);

View File

@ -31,9 +31,9 @@ public class RequestLogLine
private final DateTime timestamp;
private final String remoteAddr;
private final Query query;
private final String query;
public RequestLogLine(DateTime timestamp, String remoteAddr, Query query)
public RequestLogLine(DateTime timestamp, String remoteAddr, String query)
{
this.timestamp = timestamp;
this.remoteAddr = remoteAddr;