improve debug logging for the action set remote host info
@@ -106,8 +106,17 @@ public class SetRemoteHostInfoAction implements ActionExecutor {
}
String remoteAddr = httpServletRequest.getRemoteAddr();
+ if (logger.isDebugEnabled()) {
+ logger.debug("Remote address is " + remoteAddr);
+ }
String remoteAddrParameter = httpServletRequest.getParameter("remoteAddr");
+ if (logger.isDebugEnabled()) {
+ logger.debug("Remote address param is " + remoteAddr);
+ }
String xff = httpServletRequest.getHeader("X-Forwarded-For");
+ if (logger.isDebugEnabled()) {
+ logger.debug("X-Forwarded-For is " + xff);
+ }
if (remoteAddrParameter != null && remoteAddrParameter.length() > 0) {
remoteAddr = remoteAddrParameter;
} else if (xff != null && !xff.equals("")) {
@@ -116,6 +125,9 @@ public class SetRemoteHostInfoAction implements ActionExecutor {
}
remoteAddr = xff;
}
+ if (logger.isDebugEnabled()) {
+ logger.debug("Remote address used to localized is " + remoteAddr);
+ }
try {
if (isAValidIPAddress(remoteAddr)) {
