2 Replies Latest reply on Dec 19, 2006 10:36 AM by vijendra

    log4j.properties in jboss4.0.3

    chaituu

      http://www.jboss.org/wiki/Wiki.jsp?page=Logging

      Using your own log4j.properties file - class loader scoping


      i followed above URL.

      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 want to use my own log4j.properties and it is placed in WEB-INF of test.war directory;

      log4j1.2.4.jar placed in WEB-INF/lib directory.i made changes in jboss-web.xml.

      <class-loading java2ClassLoadingCompliance='false'>
      <loader-repository>test:loader=test.war<loader-repository-config>java2ParentDelegaton=false</loader-repository-config>
      </loader-repository>
      </class-loading>

      log4j.properties


      og4j.category.app=info, SESSME
      log4j.appender.SESSME=org.apache.log4j.RollingFileAppender
      log4j.appender.SESSME.File=${jboss.server.home.dir}/log/std.log
      log4j.appender.SESSME.MaxFileSize=5120KB
      # Keep ten backup files
      log4j.appender.SESSME.MaxBackupIndex=10
      log4j.appender.SESSME.layout=org.apache.log4j.PatternLayout
      log4j.appender.SESSME.layout.ConversionPattern=%d , %m%n

      while deploying ear in server.log i am getting this WARN message

      2005-10-26 17:42:16,578 WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: test:loader=test.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)


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


        • 1. Re: log4j.properties in jboss4.0.3
          jime

          I have the same warning. Did anyone find a resolution?

          • 2. Re: log4j.properties in jboss4.0.3
            vijendra

            I played with log4j upto a great extent. My required output was supposed to be my own logging mechanism in which i should be able to create userlog.log name kind of different file and logs should generate in specific format(name#action#parameter) so that i can read the data easily. I am able to do in some jboss locations as i am testing in many servers before deploying. By modifying in log4j.xml based on appenders(File/Console).But in my local system i am unable to test it as here file appender is not working.I get a blanck log file but things get logged in server.log here i can't get selective data in selective format. I don't know, i am missing any configuration or jboss server is having any problem or log4j.jar is having prob. For this i repalced many log4j.jar one by one and even set the classpath accordingly.But no benefit. Can anyone guide me what can be the cause of this. Vijendra