1 Reply Latest reply on Sep 24, 2011 2:25 AM by jaikiran pai

    Log4J Configuration Problems with JBoss 7.0.1 Final

    Hauke Gulich Newbie

      Hello everyone,

       

      after getting used to the new JBoss 7 (I come from JBoss 4) I managed to get everything to work, exept Log4j.

       

      In my classes I do this:

       

       

      {code}

      import org.apache.log4j.Logger;

       

      public class JMSSender {

          private static final Logger logger = Logger.getLogger(JMSSender.class);

       

          ...

       

          public void something() {

              logger.info("Something");

         }

      {code}

       

      But I get this message

       

       

      {color:#f00}

      21:35:10,396 ERROR [stderr] (http--127.0.0.1-8080-1) log4j:WARN No appenders could be found for logger (de.hauke.client.jms.JMSSender).

       

      21:35:10,396 ERROR [stderr] (http--127.0.0.1-8080-1) log4j:WARN Please initialize the log4j system properly.

       

      21:35:10,396 ERROR [stderr] (http--127.0.0.1-8080-1) log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

      {color}

       

      I am using maven and I put this dependency to my project

       

       

      {code:xml}



      <dependency>



      <groupId>log4j</groupId>



      <artifactId>log4j</artifactId>



      <version>1.2.16</version>


      </dependency>

      {code}

       

      Can somebody tell me how to configure log4j correctly? Do I have to create a log4j.xml file in my resources folder and deploy that with my ear file? I thought log4j takes to configuration from jboss. Do I have to use the LoggerFactory in some way?

       

      Best regards,

      hauke

       

      PS: Sorry for the layout in this thread, but something isn't working here ... I will try to fix that tomorrow