Skip to content
Snippets Groups Projects
Commit 15ea914f authored by brinn's avatar brinn
Browse files

[SOB=81] Log a "Session expired" exception as a warning rather than an error.

SVN: 25980
parent 96c6af6c
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
......@@ -56,6 +57,8 @@ import ch.systemsx.cisd.common.utilities.MethodUtils;
public abstract class GWTRPCServiceExporter extends RemoteServiceServlet implements
InitializingBean, ServletConfigAware, DisposableBean, BeanNameAware, Controller
{
private static final String SESSION_EXP_MSG = "Session expired. Please login again.";
private static final long serialVersionUID = 1L;
private static final Logger operationLog =
......@@ -142,12 +145,13 @@ public abstract class GWTRPCServiceExporter extends RemoteServiceServlet impleme
final String methodDescription =
String.format("Invoking method '%s' failed.", targetMethod == null ? "<unknown>"
: MethodUtils.describeMethod(targetMethod));
final Level level = SESSION_EXP_MSG.equals(cause.getMessage()) ? Level.WARN : Level.ERROR;
if (cause instanceof IOptionalStackTraceLoggingException)
{
operationLog.error(methodDescription + ": " + cause.getMessage());
operationLog.log(level, methodDescription + ": " + cause.getMessage());
} else
{
operationLog.error(methodDescription, cause);
operationLog.log(level, methodDescription, cause);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment