3 Replies Latest reply on Jan 28, 2014 6:02 PM by jamezp

    log by application not into the server.log

    zatopek

      I am migratin from eap 5 to eap 6 several application.

      i have configuured the log4j into the application into the logconfig.xml file

      burt into the EAP 6 always and only write logs into the server.xml (from the standalone sever)

      how must i configurate the server for using the application log file for the log4j?

      thanks

        • 1. Re: log by application not into the server.log
          jamezp

          What version of EAP 6 and what log4j appenders are you using?

           

          --

          James R. Perkins

          • 2. Re: log by application not into the server.log
            zatopek

            EAP 6.2, but this problem i have also into the EAP 6.1

            i am usin my log4 configuration this, for example:

            <?xml version="1.0" encoding="UTF-8" ?>

            <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J//EN" "http://logging.apache.org/log4j/docs/api/org/apache/log4j/xml/log4j.dtd">

             

             

            <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'

              debug="false">

              <!-- Append log to the CONSOLE appender -->

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

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

              <param name="ConversionPatter"

              value=" %-5p [%t] %c - %m%n" />

              </layout>

              </appender>

             

             

              <appender name="MySecondAppender"

              class="org.jboss.logging.appender.DailyRollingFileAppender">

             

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

              <param name="File" value="c:/mylog.log" />

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

             

             

              <param name="DatePattern" value="'.'yyyy-MM-dd"/>

             

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

              <param name="ConversionPattern"

              value="Message: %-5p [%d] %c - %m%n" />

              </layout>

              </appender>

              <category name="org.springmodules">

              <level value="DEBUG" />

              <appender-ref ref="MySecondAppender" />

              </category>

             

             

                <category name="uk.ltd">

              <level value="DEBUG" />

              <appender-ref ref="MySecondAppender" />

              </category>

             

             

              <category name="sql">

              <level value="DEBUG" />

              <appender-ref ref="MySecondAppender" />

              </category>

             

             

            </log4j:configuration>

            • 3. Re: log by application not into the server.log
              jamezp

              There were some bugs in EAP 6.1, but if you include your log4j.xml in your deployment and don't include any log4j libraries then it should work. See Logging Configuration - JBoss AS 7.2 - Project Documentation Editor for further details.

               

              --

              James R. Perkins