Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2624

${web:rootDir} not working in weblogic 12c

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.11.0
    • 3.0.0, 2.14.1
    • None
    • None

    Description

      The web lookup - ${web:rootDir} seems to cause problems on weblogic 12c deployment.

      I suspect that the web-lookup plugin is not initialized when weblogic requests the logger at the start of deployment and is unable to create the file.

      What I've done - 

      1. Added slf4j in weblogic preferred packages of weblogic.xml.

          <wls:package-name>org.slf4j.*</wls:package-name>

      2. log4j-web dependency is present in classpath.

      3.web.xml contains following:- 

      <context-param>
          <param-name>isLog4jAutoInitializationDisabled</param-name>
          <param-value>true</param-value>
      </context-param>

      <listener>
          <listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
      </listener>

      <filter>
          <filter-name>log4jServletFilter</filter-name>
          <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
      </filter>

      <filter-mapping>
          <filter-name>log4jServletFilter</filter-name>
          <url-pattern>/*</url-pattern>
          <dispatcher>REQUEST</dispatcher>
          <dispatcher>FORWARD</dispatcher>
          <dispatcher>INCLUDE</dispatcher>
          <dispatcher>ERROR</dispatcher>
      </filter-mapping>

      *Note - Log4jServletContextListener is placed before all listeners.

      -Have attached stacktrace for your reference.

      [^stacktrace.txt]

      Please assist.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            gaurav9822 gaurav
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment