3 Replies Latest reply on Jul 14, 2002 8:32 PM by javaguy

    Jboss 3.0.0 and Log4j #2

      Hello Again,

      Is it possible to have different package or class append to to a seperate files? I created two file appenders and set the following in my log4j.xml file
      .
      .
      .


      <appender-ref ref="fappender2" />




      <appender-ref ref="console"/>
      <appender-ref ref="fappender"/>
      <appender-ref ref="fappender2"/>


      </log4j:configuration>

      The following will log all messages from all classes (jboss and my own app) to both file appenders. What do I have to set or do to make sure that only my.package logging will go to my 2nd file appender?


      Thank You
      JG

        • 1. Re: Jboss 3.0.0 and Log4j #2



          <appender-ref ref="fappender2" />




          <appender-ref ref="console"/>
          <appender-ref ref="fappender"/>


          You might also want
          <category name="my.package" addivity="false>
          to stop my.package logging through

          Regards,
          Adrian

          • 2. Re: Jboss 3.0.0 and Log4j #2

            Adrian,

            Thanks for the reply. Everything worked except for the "additivity" which is "additive" but I am not sure the exact syntax to put it in. With your help, all my.package are going to the second appender and not the root one anymore. Of course with the additivity defaulted to "true" at the beginning, it also goes to the root logger or the fappender1.


            Thanks
            JG

            • 3. Re: Jboss 3.0.0 and Log4j #2

              Adrian,

              You can throw a few bytes and bits at me but the additivity flag for the <category ...> finally works. Thanks for you help... :-)

              Thank You Very Much!
              JG