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 &quot;%r&quot; %s %b &quot;%{referer}i&quot; &quot;%{user-agent}i&quot;" /> 

[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

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -