diff --git a/src/main/java/cokr/xit/base/syslog/ServiceCall.java b/src/main/java/cokr/xit/base/syslog/ServiceCall.java index 0cf811f..958499c 100644 --- a/src/main/java/cokr/xit/base/syslog/ServiceCall.java +++ b/src/main/java/cokr/xit/base/syslog/ServiceCall.java @@ -6,6 +6,7 @@ import java.util.List; import cokr.xit.foundation.Access; import cokr.xit.foundation.Assert; +import cokr.xit.foundation.LocalHost; import cokr.xit.foundation.UserInfo; /**서비스 요청 객체 @@ -22,7 +23,7 @@ public class ServiceCall { if (call == null) { cache.set(call = new ServiceCall()); call.userId = UserInfo.current().getId(); - call.ipAddress = Access.current().getIpAddress(); + call.ipAddress = Assert.ifEmpty(Access.current().getIpAddress(), LocalHost::getAddress); } return call; } diff --git a/src/main/java/cokr/xit/base/syslog/service/bean/LogFilter.java b/src/main/java/cokr/xit/base/syslog/service/bean/LogFilter.java index fdbc0bf..fefcf4e 100644 --- a/src/main/java/cokr/xit/base/syslog/service/bean/LogFilter.java +++ b/src/main/java/cokr/xit/base/syslog/service/bean/LogFilter.java @@ -11,6 +11,7 @@ import cokr.xit.base.file.web.DownloadView; import cokr.xit.base.file.web.XLSView; import cokr.xit.base.syslog.ServiceLog; import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; /**서비스 로그 필터. @@ -67,6 +68,11 @@ public class LogFilter extends AbstractComponent { case "onFailure": case "onLogout": log.setType(ServiceLog.LOG_INOUT); + UserInfo current = UserInfo.current(); + if (!current.isAuthenticated()) { + Object[] args = log.getArgs(); + log.setUserId(current.getId(args.length > 0 ? args[0] : null)); + } return true; default: return false; }