Proxy IP 처리
This commit is contained in:
@@ -17,6 +17,7 @@ import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.common.login.SessionManager;
|
||||
import com.eactive.eai.rms.common.util.StringUtils;
|
||||
import com.eactive.eai.util.IpUtil;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
@@ -139,7 +140,7 @@ public class RequestParameterLoggingAspect {
|
||||
HashMap<String, String> param = new HashMap<String, String>();
|
||||
param.put("schemaId", dt == null ? "" : dt.getSchema());
|
||||
param.put("id", id);
|
||||
param.put("userIp", request.getRemoteAddr());
|
||||
param.put("userIp", IpUtil.getClientIp(request));
|
||||
param.put("type", type);
|
||||
param.put("sub", sub);
|
||||
param.put("msg", msg);
|
||||
|
||||
@@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.eactive.eai.rms.common.login.SessionManager;
|
||||
import com.eactive.eai.util.IpUtil;
|
||||
|
||||
public class UserAccessLogger {
|
||||
private static final Logger ACCESS_LOGGER = Logger.getLogger("ACCESS_LOGGER");
|
||||
@@ -46,7 +47,7 @@ public class UserAccessLogger {
|
||||
if (ACCESS_LOGGER.isInfoEnabled()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("ID=").append(SessionManager.getUserId(request)).append(sep);
|
||||
sb.append("IP=").append(request.getRemoteAddr()).append(sep);
|
||||
sb.append("IP=").append(IpUtil.getClientIp(request)).append(sep);
|
||||
sb.append("TYPE=").append(type).append(sep);
|
||||
sb.append("SUB=").append(sub).append(sep);
|
||||
sb.append("MSG=").append(msg).append(sep);
|
||||
|
||||
Reference in New Issue
Block a user