0 Replies Latest reply on Oct 31, 2005 2:59 AM by chaitanya

    own log4j properties

    chaitanya Novice

      I deployed ear in default/deploy directory;

      in the ear i have war and jar ;

      in the WEB-INF directory of war i have my own log4j.properties file and also i placed log4j.jar in WEB-INF/lib directory;

      when the server is up using listener class i am reading log4j.properties file;

      below class to read log4j.properties file;its working perfectly;

      public class PropInit implements ServletContextListener
      private ServletContext context = null;
      public void contextInitialized(ServletContextEvent event)
      File logFile = null;
      logFile = new File(context.getRealPath("/WEB-INF/log4j.properties"));


      BLAH-- BLAH---

      i followed below URL.


      Using your own log4j.properties file - class loader scoping

      in default/conf directory i renamed log4j.xml to jboss-log4j.xml;and in jboss-service.xml i changed log4j.xml to jboss-log4j.xml;

      i made changes in jboss-web.xml.


      # Root category
      log4j.rootCategory=info, R
      # Pattern for standard output
      log4j.appender.stdout.layout.ConversionPattern=%d [%-5p] %c{2} %M.%L - %m%n

      og4j.category.app=info, SESSME
      # Keep ten backup files
      log4j.appender.SESSME.layout.ConversionPattern=%d , %m%n

      log files are created when the server is up but content is not going to respective log file;every time its going into server.log(i dont want that).

      i have one doubt should i write PropInit class to read log4j.properties that i placed in WEB-INF directory or else jboss will automatically read log4j.properties file ;