로그인시 IP정보 WEB_REQUEST_LOG에 저장 처리
parent
bd0c4633de
commit
472d907fba
|
|
@ -964,22 +964,22 @@ public class LoginController {
|
||||||
// client ip
|
// client ip
|
||||||
System.out.println("XFF = " + request.getHeader("X-Forwarded-For"));
|
System.out.println("XFF = " + request.getHeader("X-Forwarded-For"));
|
||||||
System.out.println("REMOTE = " + request.getRemoteAddr());
|
System.out.println("REMOTE = " + request.getRemoteAddr());
|
||||||
// clientIp = request.getHeader("X-Forwarded-For");
|
clientIp = request.getHeader("X-Forwarded-For");
|
||||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||||
// clientIp = request.getHeader("Proxy-Client-IP");
|
clientIp = request.getHeader("Proxy-Client-IP");
|
||||||
// }
|
}
|
||||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||||
// clientIp = request.getHeader("WL-Proxy-Client-IP");
|
clientIp = request.getHeader("WL-Proxy-Client-IP");
|
||||||
// }
|
}
|
||||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||||
// clientIp = request.getHeader("HTTP_CLIENT_IP");
|
clientIp = request.getHeader("HTTP_CLIENT_IP");
|
||||||
// }
|
}
|
||||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||||
// clientIp = request.getHeader("HTTP_X_FORWARDED_FOR");
|
clientIp = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||||
// }
|
}
|
||||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||||
// clientIp = request.getRemoteAddr();
|
clientIp = request.getRemoteAddr();
|
||||||
// }
|
}
|
||||||
Enumeration<String> headerNames = request.getHeaderNames();
|
Enumeration<String> headerNames = request.getHeaderNames();
|
||||||
while (headerNames.hasMoreElements()) {
|
while (headerNames.hasMoreElements()) {
|
||||||
String name = headerNames.nextElement();
|
String name = headerNames.nextElement();
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@
|
||||||
|
|
||||||
<insert id="insertWebRequestLog">
|
<insert id="insertWebRequestLog">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
INSERT INTO WEB_REQUEST_LOG (IDX,DATETIME,USERID,SESSION_ID)
|
INSERT INTO WEB_REQUEST_LOG (IDX,DATETIME,USERID,SESSION_ID,USERIP)
|
||||||
SELECT NVL(MAX(IDX), 0) + 1, SYSDATE, #{userid}, #{sessionid}
|
SELECT NVL(MAX(IDX), 0) + 1, SYSDATE, #{userid}, #{sessionid}, #{userip}
|
||||||
FROM WEB_REQUEST_LOG
|
FROM WEB_REQUEST_LOG
|
||||||
]]>
|
]]>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue