4 Replies Latest reply on Oct 26, 2005 8:43 AM by chaituu

    log4j problem

    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 in mbean i changed log4j.xml to jboss-log4j.xml;

      i want to use my own log4j.properties and it is placed in WEB-INF/classes;

      log4j1.2.4.jar placed in WEB-INF 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


      log4j.debug=true
      log4j.root=debug, R
      log4j.appender.stdout=org.apache.log4j.ConsoleAppender
      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
      # Pattern for standard output
      log4j.appender.stdout.layout.ConversionPattern=%d [%-5p] %c{2} %M.%L - %m%n
      log4j.appender.R=org.apache.log4j.RollingFileAppender
      log4j.appender.R.File=log/std.log
      log4j.appender.R.MaxFileSize=512KB
      # Keep forty backup files
      log4j.appender.R.MaxBackupIndex=40
      log4j.appender.R.layout=org.apache.log4j.PatternLayout
      log4j.appender.R.layout.ConversionPattern=%d [%-5p] %c{2} %M.%L - %m%n

        • 1. Re: log4j problem
          chaituu

          log files are creating but content is not coming in log files;

          still debug and info messages are coming in server.log;i dont want in server.log;i want to debug messages in respective log files only

          • 2. Re: log4j problem
            chaituu

            now i placed log4j.properties file in WEB-INF directory of war.
            placed log4j-1.2.4.jar in WEB-INF/lib ;

            files are created and are in default/log directory but content missing in those log files.

            renamed log4j.xml to jboss-log4j.xml;i didnt make any changes in that file;do i need to make any changes?;

            in jboss-service.xml i have grenamed to jboss-log4j.xml.

            • 3. Re: log4j problem
              chaituu

              2005-10-26 14:49:13,487 WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: testMyLoader:loader=etrans.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)

              • 4. Re: log4j problem
                chaituu

                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