5 Replies Latest reply on Mar 9, 2012 3:31 AM by Simon Cigoj

    log4j logging porblem with two same apps deployed on jboss 5.1

    Simon Cigoj Newbie

      I have two same applications deployed on one instance of jboss5.1 server, the applications are deployed to two different virtual hosts so each app has its own virtual host defined on server.


      The problem is that log4j is logging only the logs of the second application.

      My environment :





      I use the org.jboss.seam.log.Log to execute logging statements


      for examle the hosts are defined like this :

      <Host name="host1" autoDeploy="false" deployOnStartup="false" deployXML="false">




      <Host name="host2" autoDeploy="false" deployOnStartup="false" deployXML="false">




      and my jboss-log4j.xml I have the entry



      {code:xml}<!-- 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="D:\\Logs\\jboss\\server.log"/>

            <!--<param name="ImmediateFlush" value="false" />

            <param name="BufferedIO" value="true" />-->


            <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{ABSOLUTE} %-5p [%c] [%X{url}] - [%X{username}] (%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"/>







      <category name="si.arctur.fourPM.scheduleJobs.reminders.LdapImporter">

           <priority value="INFO"/>




           <priority value="${jboss.server.log.threshold}"/>

           <appender-ref ref="FILE"/>





      If i put some System.out.println() to the same places where I have my logger statements in first application I can see them in the log output, but I cann not see the loggs output off the logger statements.


      For example if i put some System.out in si.arctur.fourPM.scheduleJobs.reminders.LdapImporter I can see them in the log file but the calls to org.jboss.seam.log.Log are not written to the log...those is thrue only for the first application the second application is logging the log correctly. The applications are same the only difference is that they are deployed in different virual-hosts.


      Any clue on this, help would be appreciated?