0 Replies Latest reply on Apr 5, 2012 11:51 PM by Rob Breault

    Logging Question

    Rob Breault Newbie

      I have a couple questions about logging in Jboss 5.1.0 I have been searching the web like crazy to find an example or to know if it is possible.


      I understand that I can modify my jboss-5.1.0.GA/server/default/deploy/jbossweb.sar/server.xml file with the following to grab the jsp page response time.


                  <!-- Access logger -->


                  <Valve className="org.apache.catalina.valves.AccessLogValve"

                      prefix="localhost_access_log." suffix=".log"

                      pattern="%t %U %s %D" directory="${jboss.server.log.dir}"

                      resolveHosts="false" />


      My question is this the only way to grab this information as we also use log4j to grab everything else in the server.log. I will be configuring log4j to rsyslod so that we can centralize our logs and have not seen any info on how I can also send the access.log to the rsyslog or if I can have log4j actual capture this as well in the server.log.


      In my log4j I have the following setup and if there is a pattern I can add or pass to capture the page load time that would be awesome.


         <!-- A time/date based rolling appender -->

         <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">

            <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>

            <param name="File" value="${jboss.server.log.dir}/server.log"/>

            <param name="Append" value="true"/>

            <!-- In AS 5.0.x the server log threshold was set by a system

                 property. In 5.1 and later we are instead using the system

                 property to set the priority on the root logger (see <root/> below)

            <param name="Threshold" value="${jboss.server.log.threshold}"/>




            <!-- 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"/>




            <layout class="org.apache.log4j.PatternLayout">

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

               <!-- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/> -->

               <param name="ConversionPattern" value="%d %-5p [%c] %X{orderId} %X{sessionId} %X{requestURIWithQueryString} (%t) %m%n"/>

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

               <!-- <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> -->

               <param name="ConversionPattern" value="%d %-5r %-5p [%c] %X{orderId} %X{sessionId} %X{requestURIWithQueryString} (%t:%x) %m%n"/>







         <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">

            <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>

            <param name="Target" value="System.out"/>

            <param name="Threshold" value="INFO"/>



            <layout class="org.apache.log4j.PatternLayout">

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

               <!-- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/> -->

               <!-- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %X{profileId} %X{orderId} %X{sessionId} %X{requestURIWithQueryString} [%c{1}] %m%n"/> -->

               <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %X{profileId} %X{orderId} %X{sessionId} %X{requestURIWithQueryString} (%t) %m%n"/>




      I know the convention on linux is to use the syslog server but where I work they have implemented rsyslog instead but I am guessing I can use the same config example below to configure that correct?


         <!-- Syslog events

         <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">

           <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>

           <param name="Facility" value="LOCAL7"/>

           <param name="FacilityPrinting" value="true"/>

           <param name="SyslogHost" value="localhost"/>

           <layout class="org.apache.log4j.PatternLayout">

             <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>





      Thanks in advance for any advice.