3 Replies Latest reply on Nov 3, 2005 12:35 PM by n2

    Cannot Make a Web Log with Jboss 4.0.3.

    flubdgub

      The docs I have found do not seem to work for logging in general and have been very poor quality. I can find nothing at all anywhere with regards to performing the following simple task:

      Log web requests (http) to webserver.log file on a standard JBoss/Tomcat 4.0.3 install.

      Here's what I did to a default unmodified conf/log4j.xml:

      1. Added a New appender called WEBLOG:






      <!-- Rollover at midnight each day -->
      <param name="DatePattern" value="'.'yyyy-MM-dd"/>

      <!-- Rollover at the top of each hour
      <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
      -->


      <!-- The default pattern: Date Priority [Category] Message\n -->


      <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n

      -->



      2. Added the following categories to this appender in a futile attempt to capture web traffic.


      <appender-ref ref="WEBLOG"/>




      <appender-ref ref="WEBLOG"/>




      <appender-ref ref="WEBLOG"/>



      Finally added WEBLOG to the root:


      <appender-ref ref="CONSOLE"/>
      <appender-ref ref="FILE"/>
      <appender-ref ref="WEBLOG"/>



      According to my reading of the docs, this should have logged Apache and Tomcat based stuff to webserver.log file.

      However, all this does is make an empty file called webserver.log. Everything is still logged to server.log. I have never once been able to get a single byte logged to a third log file no matter what configuration I try.


      So it just doesn't appear work as documented. Shrug. Is it even possible to do what I want? Do I have to interpose Apache just to get some standard web logs happening?

        • 1. Re: Cannot Make a Web Log with Jboss 4.0.3.
          flubdgub

          I see the forum has kindly masked out most of the configuration I posted rendering my post incomplete. That's handy too!

          • 2. Re: Cannot Make a Web Log with Jboss 4.0.3.
            darranl

            Wrap the configuration with [ code ][ /code ] tags without the spaces and use the prview button to make sure it displays correctly.

            • 3. Re: Cannot Make a Web Log with Jboss 4.0.3.
              n2

              Its easy, flubdgub:

              Uncomment the following lines in the file: [jboss_home]/server/[name]/deploy/jbossweb-tomcat55.sar/server.xml

              <!-- Access logger -->
              <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
               prefix="localhost_access_log." suffix=".log"
               pattern="common" directory="${jboss.server.home.dir}/log"
               resolveHosts="false" />
              

              (Uncommenting in XML means removing <!-- and -->)

              Restart the server and you fill find the file [jboss_home]/server/[name]/log/localhost_access_log.[date].log