Jump to content
We've recently updated our Privacy Statement, available here ×
  • Add header to Tomcat Access Log Valve


    ghudson_1
    • Version: v7 Product: JasperReports® Server

    Issue Description

    When trouble-shooting issues involving proxies, authentication, etc it is sometimes helpful to determine exactly what inbound HTTP header values are hitting your appserver prior to entering the TIBCO JasperReports® Server servlet-based webapp.


    Resolution

    Tomcat's AccessLogValve provides basic webserver-style logging of http requests.

    Edit your tomcat's server.xml and add or adjust the AccessLogValve,  for reference see https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html

    In the example below i'm logging four potential HTTP headers in addition to typical items you'd prefer to have like url, time, ip, etc: host HOST X-Forwarded-Proto X-Forwarded-Host

    <Valve className="org.apache.catalina.valves.AccessLogValve"
           directory="logs" prefix="localhost_access_log" suffix=".txt"
           pattern="%{host}i %{HOST}i %{X-Forwarded-Proto}i %{X-Forwarded-Host}ii  %h %l %u %t &quot;%r&quot; %s %b" />

    A restart is required.  The resulting logging in this example would be found in your /logs/localhost_access_log..txt  


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...