7 Replies Latest reply on Nov 14, 2006 11:12 AM by peterj

    Help needed for Logging SAR files

    riji

      Hi all,

      I have an SAR file in jboss/default/deploy directory. Could anyone help me in knowing these following.

      1. Where log configuration file "log4j.xml" has to be located. what would be its path in SAR files.

      2.how to get logs from these files.

      Thanks in advance.

      Regards,
      Rijil

        • 1. Re: Help needed for Logging SAR files
          jaikiran

          You can add your appenders/loggers in the log4j.xml that comes in JBoss(this is the easiest approach). Its present in the %JBOSS_HOME%/server/default/conf folder

          • 2. Re: Help needed for Logging SAR files
            riji

            Hi Jaikiran,

            Appreciate your help.

            We want the container level (/default/lib) "log4j.jar" to log messages. We have our application level log4j.xml which has defined appenders/loggers. The logs are picked up now, but only following message is logged.

            [10 Nov 2006 - 10:54:58] - This is used for testing.

            I want to get the Log levels here. Could it be possibe to put it in a better way.

            Regards,
            Rijil

            • 3. Re: Help needed for Logging SAR files
              jaikiran

              Can you post the contents of your log4j.xml(Remember to use the "Code" button to wrap the contents in a code block while posting).

              • 4. Re: Help needed for Logging SAR files
                riji

                hi Jaikiran, Sorry for late reply.

                Here is my log4j.xml

                <?xml version="1.0" encoding="UTF-8"?>
                <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">















                <appender-ref ref="test"/>
                <appender-ref ref="SunAm"/>

                </log4j:configuration>

                I have 2 appenders and I want my logs to go to both the log files. This is not happeneing. Only to ${jboss.server.home.dir}/log/test.log the logs are written. the other appender is at container level.

                My SAR structure is given below.

                SAR
                com-all class files
                log4j.xml
                META-INF/jboss-service.xml
                WEB-INF/web.xml
                WEB-INF/lib- all jars

                It would be very grateful if you would be able to help me in this regard.

                Thanks in advance

                • 5. Re: Help needed for Logging SAR files
                  riji

                  <?xml version="1.0" encoding="UTF-8"?>
                  <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">















                  <appender-ref ref="test"/>
                  <appender-ref ref="SunAm"/>

                  </log4j:configuration>

                  • 6. Re: Help needed for Logging SAR files
                    riji

                    <?xml version="1.0" encoding="UTF-8"?>
                    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

                    1.
                    2
                    3

                    4
                    5
                    6
                    7
                    8
                    9
                    10

                    11
                    12
                    13 <appender-ref ref="bcc"/>
                    14 <appender-ref ref="QuantumSunAm"/>
                    15
                    16</log4j:configuration>

                    • 7. Re: Help needed for Logging SAR files
                      peterj

                      Enclose your code within [ code ] ... [ /code ] tags (without the spaces). Or select the code and click on the Code button.