Project

General

Profile

Actions

Task #9155

closed

Modify the tomcat logger so that it reports the remote client IP in the access log

Added by Andrea Dell'Amico almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
_InfraScience Systems Engineer
Category:
System Application
Target version:
Start date:
Jul 04, 2017
Due date:
% Done:

100%

Estimated time:
Infrastructure:
Development, Pre-Production, Production

Description

Right now it reports the reverse proxy host (usually localhost).

Actions #1

Updated by Andrea Dell'Amico almost 8 years ago

  • Status changed from New to In Progress

We already set the X-Forwarded-For header, so we can exploit it. We need to change the pattern definition inside the AccessLogValve, this way:

pattern="%t %{org.apache.catalina.AccessLog.RemoteAddr}r %{X-AUSERNAME}o %I %s "%r" %b %{User-Agent}i"
Actions #2

Updated by Andrea Dell'Amico almost 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Changed the tomcat and tomcat-multiple-instances templates.

The behaviour can be reverted setting the variable tomcat_direct_access (tomcat role) and tomcat_m_direct_access (tomcat-multiple-instances role) to True.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)