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

Weblookup ${web:rootDir} is not working if old loggercontext is removed and tried to initialize loggerContext using Configurator.initialize

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Blocker
    • Resolution: Won't Do
    • 2.15.0, 2.16.0
    • None
    • Configurators
    • Important

    Description

      In a web application, I am first creating a loggerContext and it log4j.xml  has ${web:rootDir} for lookup. It is resolved as expected. 

      I am removing the older loggerContext and using Configurator.initialize(contextName, classlodaer, filePaths, context). This API fails and I can observe that inside weblookup it is NOT getting servletContext. Below API returns null. 

      ServletContext ctx = WebLoggerContextUtils.getServletContext();

      Attachments

        1. console.log
          25 kB
          Sankalp

        Activity

          People

            Unassigned Unassigned
            sankalpshah Sankalp
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: