4 Replies Latest reply on Aug 25, 2009 3:40 AM by elhanan

    log messages printed twice to the console

    elhanan

      this is insane!!, i keep getting our ear info messages printed twice to the console, we do have log4j.xml in our ear and it's running in isolated mode, but i cannot detect where is the duplicity becouse we only have one package logger in jboss-log4j.xml

        • 1. Re: log messages printed twice to the console
          jaikiran

          Post the contents of your log4j.xml

          • 2. Re: log messages printed twice to the console
            elhanan

            this is the one inf the ear file

            <?xml version='1.0' encoding='ISO-8859-1' ?>
            <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
            
            <log4j:configuration>
            
             <appender name="PMP_FILE" class="org.apache.log4j.RollingFileAppender">
             <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
             <param name="File" value="underwrite-log.log"/>
             <!--<param name="Append" value="false"/>-->
             <param name="MaxFileSize" value="5000KB"/>
             <param name="MaxBackupIndex" value="10"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
             value="%d{dd MMM yyyy HH:mm:ss,SSS} [%-5p] %c %x - %m%n"/>
             </layout>
             </appender>
            
             <appender name="PERF_FILE" class="org.apache.log4j.RollingFileAppender">
             <param name="File" value="pmp-perf-log.csv"/>
             <param name="MaxFileSize" value="5000KB"/>
             <param name="MaxBackupIndex" value="10"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
             value="%d{dd MMM yyyy HH:mm:ss,SSS} [%-5p] %c %x - %m%n"/>
             </layout>
             </appender>
            
            <!--
             <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="DEBUG"/>
            
             <layout class="org.apache.log4j.PatternLayout">
            
             <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
             </layout>
             </appender>
            -->
             <!--appender name="HB8_FILE" class="org.apache.log4j.RollingFileAppender">
             <param name="File" value="hb8-log.log"/>
             <param name="MaxFileSize" value="5000KB"/>
             <param name="MaxBackupIndex" value="10"/>
            
             <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern"
             value="%d{dd MMM yyyy HH:mm:ss,SSS} [%-5p] %c %x - %m%n"/>
             </layout>
             </appender-->
            
            <!--
             <logger name="org.springframework.transaction" additivity="true">
             <level value="ALL"/>
             <appender-ref ref="PMP_FILE"/>
             <appender-ref ref="CONSOLE"/>
            
             </logger>
             -->
             <!--logger name="org.hibernate">
             <level value="TRACE"/>
             <appender-ref ref="HB8_FILE"/>
             </logger-->
            
             <!--<logger name="com.pnx.pmp.common.log.PerformanceWatch" additivity="false">
             <level value="DEBUG"/>
             <appender-ref ref="PERF_FILE"/>
             </logger>-->
            
             <!--
             <logger name="net.sf.hibernate.SQL">
             <level value="DEBUG"/>
             <appender-ref ref="STDOUT"/>
             </logger>
             -->
            
             <!--
             <logger name="log4j.logger.org.apache">
             <level value="WARN"/>
             <appender-ref ref="STDOUT"/>
             </logger>
            
             <logger name="org.springframework">
             <level value="INFO"/>
             <appender-ref ref="STDOUT"/>
             </logger>
            
             <logger name="net.sf.hibernate">
             <level value="INFO"/>
             <appender-ref ref="STDOUT"/>
             </logger>
            
             <logger name="com.opensymphony.webwork">
             <level value="INFO"/>
             <appender-ref ref="STDOUT"/>
             </logger>
            
             <logger name="org.apache.velocity">
             <level value="INFO"/>
             <appender-ref ref="STDOUT"/>
             </logger>
             -->
            
             <!--
             Leave root definition commented !
             When uncommented it causes problems on JBoss.
             -->
             <!--<root>-->
             <!--<priority value="ERROR"/>-->
             <!--<appender-ref ref="FILE"/>-->
             <!--</root>-->
            
            </log4j:configuration>
            


            • 3. Re: log messages printed twice to the console
              jaikiran

              Apart from a couple of appenders, which are not used in any of the configurations, everything else in that configuration is commented out. So i don't see how that log4j configuration file is useful. What do the contents of jboss-log4j.xml look like?

              • 4. Re: log messages printed twice to the console
                elhanan

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

                <!-- ===================================================================== -->
                <!-- -->
                <!-- Log4j Configuration -->
                <!-- -->
                <!-- ===================================================================== -->

                <!-- $Id: jboss-log4j.xml 75507 2008-07-08 20:15:07Z stan.silvert@jboss.com $ -->

                <!--
                | For more configuration infromation and examples see the Jakarta Log4j
                | owebsite: http://jakarta.apache.org/log4j
                -->

                <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

                <!-- ================================= -->
                <!-- Preserve messages in a local file -->
                <!-- ================================= -->

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





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

                -->



                <!-- A size based file rolling appender











                -->

                <!-- ============================== -->
                <!-- Append messages to the console -->
                <!-- ============================== -->







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












                <!-- ====================== -->
                <!-- More Appender examples -->
                <!-- ====================== -->

                <!-- Buffer events and log them asynchronously


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

                -->

                <!-- EMail events to an administrator












                -->

                <!-- Syslog events









                -->

                <!-- Log events to JMS (requires a topic to be created)






                -->

                <!-- Log events through SNMP


















                -->

                <!-- Emit events as JMX notifications










                -->

                <!-- ================ -->
                <!-- Limit categories -->
                <!-- ================ -->

                <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
                <!--category name="org.apache">

























                </category-->

                <!-- Limit the jacorb category to WARN as its INFO is verbose -->
                <!--category name="jacorb">

                </category-->

                <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
                <!--category name="org.jgroups">





                </category-->

                <!-- Limit the org.quartz category to INFO as its DEBUG is verbose -->
                <!--category name="org.quartz">

                </category-->

                <!-- Limit JSF logging to DEBUG. FINER and FINEST will not be logged -->
                <!--category name="javax.enterprise.resource.webcontainer.jsf">

                </category-->

                <!-- Limit JBoss categories



                -->

                <!-- Limit the JSR77 categories -->
                <!--category name="org.jboss.management">

                </category-->

                <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]



                -->

                <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
                <!--category name="org.jboss.serial">

                </category-->

                <!-- Decrease the priority threshold for the org.jboss.varia category



                -->

                <!-- Enable JBossWS message tracing



                -->

                <!--
                | An example of enabling the custom TRACE level priority that is used
                | by the JBoss internals to diagnose low level details. This example
                | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
                | subpackages. This will produce A LOT of logging output.
                |
                | Note: since jboss AS 4.2.x, the trace level is supported natively by
                | log4j, so although the custom org.jboss.logging.XLevel priority will
                | still work, there is no need to use it. The two examples that follow
                | will both enable trace logging.






                -->

                <!--
                | Logs these events to SNMP:
                - server starts/stops
                - cluster evolution (node death/startup)
                - When an EJB archive is deployed (and associated verified messages)
                - When an EAR archive is deployed



                <appender-ref ref="TRAP_LOG"/>




                <appender-ref ref="TRAP_LOG"/>




                <appender-ref ref="TRAP_LOG"/>




                <appender-ref ref="TRAP_LOG"/>




                <appender-ref ref="TRAP_LOG"/>

                -->

                <!-- Clustering logging -->
                <!-- Uncomment the following to redirect the org.jgroups and
                org.jboss.ha categories to a cluster.log file.














                <appender-ref ref="CLUSTER"/>



                <appender-ref ref="CLUSTER"/>

                -->


                <appender-ref ref="CONSOLE"/>
                <appender-ref ref="SocketAppender"/>



                <appender-ref ref="CONSOLE"/>


                <!-- ======================= -->
                <!-- Setup the Root category -->
                <!-- ======================= -->

                <!--root>
                <appender-ref ref="CONSOLE"/>
                <appender-ref ref="FILE"/>
                </root-->

                </log4j:configuration>