Skip to content

Commit 5b922cd

Browse files
author
Christopher Frost
committed
Update the AccessLog pattern to show more
The existing pattern doesn't show the IP address of the original requester. This change adds a value of '%{org.apache.catalina.AccessLog.RemoteAddr}r' to show the IP address of the original requester as provided by the RemoteIpValve. '%a' will continue to show the IP address of the Router. [#75588342]
1 parent 0ed2016 commit 5b922cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

resources/tomcat/conf/server.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<Engine defaultHost='localhost' name='Catalina'>
2727
<Valve className="org.apache.catalina.valves.RemoteIpValve" protocolHeader="x-forwarded-proto"/>
2828
<Valve className="com.gopivotal.cloudfoundry.tomcat.logging.access.CloudFoundryAccessLoggingValve"
29-
pattern='[ACCESS] %h %l %t %D %F %B %S vcap_request_id:%{X-Vcap-Request-Id}i' enabled="${access.logging.enabled}"/>
29+
pattern='[ACCESS] %{org.apache.catalina.AccessLog.RemoteAddr}r %l %t %D %F %B %S vcap_request_id:%{X-Vcap-Request-Id}i x-forwarded-for:[%{org.apache.catalina.AccessLog.RemoteAddr}r, %a]'
30+
enabled="${access.logging.enabled}"/>
3031
<Host name='localhost'>
3132
<Listener className="com.gopivotal.cloudfoundry.tomcat.lifecycle.ApplicationStartupFailureDetectingLifecycleListener"/>
3233
</Host>

0 commit comments

Comments
 (0)