Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

support for request/response logging #20

Merged
merged 1 commit into from

2 participants

@sarmbruster

If system property org.neo4j.rest.logging_filter is set to true, verbose request/response logging using Jersey's com.sun.jersey.api.client.filter.LoggingFilter is enabled.

@sarmbruster sarmbruster support for LoggingFIlter
If system property org.neo4j.rest.logging_filter is set to true, verbose request/response logging using Jersey's com.sun.jersey.api.client.filter.LoggingFilter is enabled.
4fb2b1a
@jexp jexp merged commit b42d317 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 5, 2012
  1. @sarmbruster

    support for LoggingFIlter

    sarmbruster authored
    If system property org.neo4j.rest.logging_filter is set to true, verbose request/response logging using Jersey's com.sun.jersey.api.client.filter.LoggingFilter is enabled.
This page is out of date. Refresh to see the latest.
View
3  README.md
@@ -71,5 +71,4 @@ _timeouts in seconds_
* org.neo4j.rest.driver="neo4j-rest-graphdb/1.8M07"
* org.neo4j.rest.stream=true
* org.neo4j.rest.batch_transactions=true (convert transaction scope into batch-rest-operations)
-
-
+* org.neo4j.rest.logging_filter=false (set to true if verbose request/response logging should be enabled)
View
4 src/main/java/org/neo4j/rest/graphdb/ExecutingRestRequest.java
@@ -27,6 +27,7 @@
import javax.ws.rs.core.MediaType;
+import com.sun.jersey.api.client.filter.LoggingFilter;
import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.rest.graphdb.util.Config;
import org.neo4j.rest.graphdb.util.JsonHelper;
@@ -69,6 +70,9 @@ protected Client createClient() {
client.setReadTimeout(Config.getReadTimeout());
client.setChunkedEncodingSize(8*1024);
userAgent.install(client);
+ if (Config.useLoggingFilter()) {
+ client.addFilter(new LoggingFilter());
+ }
return client;
}
View
5 src/main/java/org/neo4j/rest/graphdb/util/Config.java
@@ -25,6 +25,7 @@
public final static String CONFIG_PREFIX = "org.neo4j.rest.";
public static final String CONFIG_STREAM = CONFIG_PREFIX + "stream";
public static final String CONFIG_BATCH_TRANSACTION = CONFIG_PREFIX+"batch_transaction";
+ public static final String CONFIG_LOG_REQUESTS = CONFIG_PREFIX+"logging_filter";
public static int getConnectTimeout() {
return getTimeout("connect_timeout", 30);
@@ -42,6 +43,10 @@ public static boolean useBatchTransactions() {
return System.getProperty(CONFIG_BATCH_TRANSACTION,"true").equalsIgnoreCase("true");
}
+ public static boolean useLoggingFilter() {
+ return System.getProperty(CONFIG_LOG_REQUESTS,"false").equalsIgnoreCase("true");
+ }
+
private static int getTimeout(final String param, final int defaultValue) {
return (int) TimeUnit.SECONDS.toMillis(Integer.parseInt(System.getProperty(CONFIG_PREFIX + param, "" + defaultValue)));
}
Something went wrong with that request. Please try again.