5 Replies Latest reply on Mar 19, 2008 4:15 PM by 666705

    log4j:WARN No appenders could be found

    666705
      We are using weblogic 10.0.1 and JDK 1.6.
      We are using Log4j for logging, if I pass -Dlog4j.configuration=log4jconfig.xml in the startup script as a command line parameter weblogic console is displaying following warning messages. However, system properly initializes Log4j properly.
      Looks like beehive loggers are not initialized properly. In our log4jconfig.xml we have added appender for org.apache.
      log4j:WARN No appenders could be found for logger (org.apache.beehive.netui.pageflow.internal.AdapterManager).
      log4j:WARN Please initialize the log4j system properly.

      Please advise
        • 1. Re: log4j:WARN No appenders could be found
          666705
          we get the same warning, I neglected it though... waiting on reply for this thread...

          --
          Edited by vamsi37 at 05/30/2007 12:59 PM
          • 2. Re: log4j:WARN No appenders could be found
            666705
            I received the same error in WLS9.2 and after I implemented log4j at the application level, everything was fine.

            I simply added the log4j.jar to the WEB-INF/lib directory and the log4j.xml or log4j.properties file to the WEB-INF/classes directory. You also have to make sure that you include the correct path of where the server.log is stored in the WLS directory structure. This will generate several file not found errors.
            • 3. Re: log4j:WARN No appenders could be found
              666705
              I'm having the same problem with weblogic 10.0, I've put the log4j.jar and wllog4j.jar in the classpath, added the log4jconfig.xml in the setDomainEnv.sh -Dlog4j.configuration but the error persists.
              • 4. Re: log4j:WARN No appenders could be found
                666705
                I've the same problem on weblogic 10.0.

                When the application code calls commons LogFactory for the first time, I see the following error messages.

                --------------
                log4j:WARN No appenders could be found for logger (com.xxx.TestClass).
                log4j:WARN Please initialize the log4j system properly.

                --------------

                Can someone explain why the same config file/setup works with Weblogic 8.1 but not with Weblogic 10.

                Thanks
                Kambiz


                Here is my folder structure

                -webroot
                +
                +-WEB-INF
                +classes
                | |--log4j.properties
                +lib
                +commons-logging.jar
                +log4j-1.2.15.jar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                • 5. Re: log4j:WARN No appenders could be found
                  666705
                  Hello,

                  Although in a quite unorthodox method, I mannaged to configure the Log4J to be used within Weblogic 10.0.1
                  Note: *nix based configuration, in Windows the references, noted in ${...} and export, may vary.

                  --------------------------------------------------------------------------------
                  Edit the configuration in the setDomainEnv.sh (located in you Domain/bin),

                  you shall find the following lines:
                  ===============================================
                  if [ "${LOG4J_CONFIG_FILE}" != "" ] ; then
                  JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dlog4j.configuration=file:${LOG4J_CONFIG_FILE}"
                  export JAVA_PROPERTIES
                  fi
                  ===============================================
                  ----------------------------------------------------------------------
                  and add the following configuration immediatelly before:

                  =================================================
                  LOG4J_CONFIG_FILE="Path_To_Properties_File"
                  export LOG4J_CONFIG_FILE
                  =================================================
                  ------------------------------------------------------------------------
                  Basically this configure your Log4J properties passing it to the weblogic server to configure.

                  Note that the Log4J properties file (in this method) is within the domain file_system, not within the WebApp file System.

                  If your logger uses a third party (or proprietary) appender, it is recommended to copy it (or the Jar containing it) to the ${DOMAIN_HOME}/lib directory.

                  This works only for Admin Server, however, it solved our troubles in an immediate way. If anyone knows of a better solution, please let us know.