4 Replies Latest reply on Feb 1, 2005 5:39 PM by valban

    Tomcat log

    valban

      Dear jboss experts...

      I've some trouble with the tomcat AccessLogValve.
      My server.xml

      <Engine....
      <Valve className="org.apache.catalina.valves.AccessLogValve"
       prefix="tomcat_access" suffix=".log" pattern="combined" directory="${jboss.server.home.dir}/log"/>
      
      <Host name="test.com">
       <Alias>www.test.com</Alias>
       <Valve className="org.apache.catalina.valves.AccessLogValve"
       prefix="guide-verbier_access" suffix=".log" pattern="combined" directory="${jboss.server.home.dir}/log"/>
       <Valve className="org.apache.catalina.valves.AccessLogValve"
       prefix="test" suffix=".log"
       pattern="common" directory="${jboss.server.home.dir}/log"/>
       <!-- Default context parameters -->
       <DefaultContext cookies="true" crossContext="true" override="true"/>
       </Host>


      The first AccessLogValve works fine. The second, the host AccessLogValve does'nt log anything... I've tried with tomcat 5 and it works... Is it a JBoss probleme?

      Tanks

        • 1. Re: Tomcat log
          starksm64

          The following server.xml works fine for me with the jboss-4.0.1 release:

          <Server>
          
           <!-- Use a custom version of StandardService that allows the
           connectors to be started independent of the normal lifecycle
           start to allow web apps to be deployed before starting the
           connectors.
           -->
           <Service name="jboss.web"
           className="org.jboss.web.tomcat.tc5.StandardService">
          
           <!-- A HTTP/1.1 Connector on port 8080 -->
           <Connector port="8080" address="${jboss.bind.address}"
           maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
           enableLookups="false" redirectPort="8443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true"/>
          
           <Engine name="jboss.web" defaultHost="localhost">
          
           <!-- The JAAS based authentication and authorization realm implementation
           that is compatible with the jboss 3.2.x realm implementation.
           - certificatePrincipal : the class name of the
           org.jboss.security.auth.certs.CertificatePrincipal impl
           used for mapping X509[] cert chains to a Princpal.
           -->
           <Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
           certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
           />
           <Logger className="org.jboss.web.tomcat.Log4jLogger"
           verbosityLevel="WARNING"
           category="org.jboss.web.localhost.Engine"/>
          
           <Host name="localhost"
           autoDeploy="false" deployOnStartup="false" deployXML="false">
          
           <!-- Access logger -->
           <Valve className="org.apache.catalina.valves.AccessLogValve"
           prefix="localhost_access_log." suffix=".log"
           pattern="common" directory="${jboss.server.home.dir}/log"
           resolveHosts="false" />
          
           <!-- Default context parameters -->
           <DefaultContext cookies="true" crossContext="true" override="true"/>
           </Host>
          
           <Host name="vhost1.test.com">
           <Alias>www.test.com</Alias>
           <Valve className="org.apache.catalina.valves.AccessLogValve"
           prefix="test_access." suffix=".log"
           pattern="common" directory="${jboss.server.home.dir}/log"/>
           <!-- Default context parameters -->
           <DefaultContext cookies="true" crossContext="true" override="true"/>
           </Host>
           </Engine>
          
           </Service>
          
          </Server>
          


          Both localhost_access_log and test_access logs are seen:
          [starksm@banshee9100 log]$ ls -l
          total 141
          -rwxr-xr-x 1 starksm None 27227 Feb 1 12:23 boot.log*
          -rwxr-xr-x 1 starksm None 341 Feb 1 12:24 localhost_access_log.2005-02-01.log*
          -rwxr-xr-x 1 starksm None 114457 Feb 1 12:23 server.log*
          -rwxr-xr-x 1 starksm None 90 Feb 1 12:23 test_access.2005-02-01.log*
          



          • 2. Re: Tomcat log
            valban

            Ohh i realize that i should have other problems... Can I see your jboss-web.xml.

            Witch file is used to resolve the host name... the jboss-web.xml???

            <jboss-web>
             <!-- Uncomment the security-domain to enable security. You will
             need to edit the htmladaptor login configuration to setup the
             login modules used to authentication users.
             <security-domain>java:/jaas/jmx-console</security-domain>
             -->
             <virtual-host>localhost</virtual-host>
             <virtual-host>vhost1.mydot.com</virtual-host>
             <virtual-host>vhost2-alias</virtual-host>
            </jboss-web>


            Because the log files are created but empty... Who and when call the server.xml AccessLogValve ?

            • 3. Re: Tomcat log
              starksm64

               

              [starksm@banshee9100 vhost_log]$ cat deploy/jmx-console.war/WEB-INF/jboss-web.xml
              <jboss-web>
               <!-- Uncomment the security-domain to enable security. You will
               need to edit the htmladaptor login configuration to setup the
               login modules used to authentication users.
               <security-domain>java:/jaas/jmx-console</security-domain>
               -->
               <virtual-host>localhost</virtual-host>
               <virtual-host>vhost1.test.com</virtual-host>
              </jboss-web>
              



              • 4. Re: Tomcat log
                valban

                For sure... It works...

                Thank you Scott