diff --git a/main/src/com/google/refine/RefineServlet.java b/main/src/com/google/refine/RefineServlet.java index d137ae316..8b033f9ca 100644 --- a/main/src/com/google/refine/RefineServlet.java +++ b/main/src/com/google/refine/RefineServlet.java @@ -164,14 +164,14 @@ public class RefineServlet extends Butterfly { Command command = commands.get(commandKey); if (command != null) { if (request.getMethod().equals("GET")) { - if (!logger.isTraceEnabled()) { + if (!logger.isTraceEnabled() && command.logRequests()) { logger.info("GET {}", request.getPathInfo()); } logger.trace("> GET {}", commandKey); command.doGet(request, response); logger.trace("< GET {}", commandKey); } else if (request.getMethod().equals("POST")) { - if (!logger.isTraceEnabled()) { + if (!logger.isTraceEnabled() && command.logRequests()) { logger.info("POST {}", request.getPathInfo()); } logger.trace("> POST {}", commandKey); diff --git a/main/src/com/google/refine/commands/Command.java b/main/src/com/google/refine/commands/Command.java index 1dd25510f..755a9217d 100644 --- a/main/src/com/google/refine/commands/Command.java +++ b/main/src/com/google/refine/commands/Command.java @@ -86,6 +86,15 @@ public abstract class Command { throw new UnsupportedOperationException(); }; + /** + * Whether each request to this command should be logged. For some commands + * that can get called too frequently, such as GetProcessesCommand, logging + * is very distracting. + */ + public boolean logRequests() { + return true; + } + /** * Utility function to get the browsing engine's configuration as a JSON object * from the "engine" request parameter, most often in the POST body. diff --git a/main/src/com/google/refine/commands/history/GetProcessesCommand.java b/main/src/com/google/refine/commands/history/GetProcessesCommand.java index dd5262d9d..2768edeba 100644 --- a/main/src/com/google/refine/commands/history/GetProcessesCommand.java +++ b/main/src/com/google/refine/commands/history/GetProcessesCommand.java @@ -57,4 +57,9 @@ public class GetProcessesCommand extends Command { respondException(response, e); } } + + @Override + public boolean logRequests() { + return false; + } } diff --git a/server/src/log4j.properties b/server/src/log4j.properties index e7ef6a361..8a0efd533 100644 --- a/server/src/log4j.properties +++ b/server/src/log4j.properties @@ -5,3 +5,7 @@ log4j.logger.velocity=WARN log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.layout=com.google.util.logging.IndentingLayout + +log4j.logger.butterfly=ERROR +log4j.logger.refine=INFO +log4j.logger.FileProjectManager=WARN