Wednesday 15 March 2017

Enable Access logs in JBOSS 7.2.1


In order to enable access logs in JBOSS 7.2.1,Please refer below steps:

  1. Go to JBOSS_HOME/standalone/configuration folder.
  2. Open Standalone.xml and put following snippet under <subsystem xmlns="urn:jboss:domain:web:1.4">

 <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" instance-id="${jboss.instance-id.jvmRoute}" native="false">  
       <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" max-connections="250"/>  
       <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp" max-connections="250"/>  
       <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">  
         <ssl name="https" password="g04theau" certificate-key-file="/opt/jboss/certs/wildcard.prod.ch3.s.com.jks"/>  
       </connector>  
       <virtual-server name="default-host" enable-welcome-root="false">  
         <alias name="localhost"/>  
         <alias name="example.com"/>  
         <access-log pattern='%h&#9;%p&#9;%l&#9;%u&#9;%t&#9;"%r"&#9;%s&#9;%b&#9;"%{Referer}i"&#9;"%{User-Agent}i"&#9;%D&#9;"%{X-Forwarded-For}i"&#9;"%{True-Clien  
 t-IP}i"&#9;"%{JSESSIONID}c"' prefix="access-log-" rotate="true">  
           <directory path="." relative-to="jboss.server.log.dir"/>  
         </access-log>  
       </virtual-server>  
     </subsystem>  

For access log pattern configuration, refer Access log Patterns

Enjoy Learning.

No comments:

Post a Comment