current user variable not available in access log

Issue #877 closed
Sebastian Sdorra repo owner created an issue

The current authenticated username is not available in the access log of the application server nor in the access logs of reverse proxies. The problem could be fixed by creating an HttpServletRequestWrapper that returns the username on the getRemoteUser method.

Comments (6)

  1. Sebastian Sdorra reporter

    The username is now stored in the request attribute principal. For tomcat access log use a valve like the following:

    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                prefix="localhost_access_log" suffix=".txt"
                pattern="%h %l %u %{principal}r %t &quot;%r&quot; %s %b" />
    
  2. Log in to comment