wso2 - WSO2IS logging client IP into file wso2carbon.log -
i have environment wso2is behind balancer , client ip logged file wso2carbon.log beyond http_access.log file.
on application log need manually parse value log. shall ip address request. may add thread local , configure pattern layout[5].
string ipaddress = request.getheader("x-forwarded-for"); if (ipaddress == null) { ipaddress = request.getremoteaddr(); }
you may use request header "x-forwarded-for"[1].
<valve classname="org.apache.catalina.valves.accesslogvalve" directory="${carbon.home}/repository/logs" prefix="http_access_management_console_" suffix=".log" pattern="%{x-forwarded-for}i %h %l %u %t "%r" %s %b "%{referer}i" "%{user-agent}i"" />
[2]
[1].https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#proxies_support [2].https://docs.wso2.com/display/esb490/access+logs
[3].http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#access_log_valve
[4].http://www.techstacks.com/howto/configure-access-logging-in-tomcat.html [5].https://logging.apache.org/log4j/2.x/manual/thread-context.html
Comments
Post a Comment