Log4j 2
  1. Log4j 2
  2. LOG4J2-394

ClassLoaderContextSelector logging WARN messages

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: None
    • Component/s: Configurators
    • Labels:
      None

      Description

      I am getting the following WARN message everytime my application logs something.


      WARN locateContext called with URI null. Existing LoggerContext has URI classpath:log4j/local.log4j.xml

      I traced this to ClassLoaderContextSelector -

      if (ctx != null) {
                  if (ctx.getConfigLocation() == null && configLocation != null) {
                      LOGGER.debug("Setting configuration to {}", configLocation);
                      ctx.setConfigLocation(configLocation);
                  } else if (ctx.getConfigLocation() != null && !ctx.getConfigLocation().equals(configLocation)) {
                      LOGGER.warn("locateContext called with URI {}. Existing LoggerContext has URI {}", configLocation,
                          ctx.getConfigLocation());
                  }
                  return ctx;
              }
      

      Ralph Goers Ralph Goers Why are we logging these WARN messages?

        Issue Links

          Activity

          Hide
          Ralph Goers added a comment -

          This was fixed in revision 1522754 back in September. Please verify and close.

          Show
          Ralph Goers added a comment - This was fixed in revision 1522754 back in September. Please verify and close.
          Hide
          Nick Williams added a comment -

          Okay. I see now that he filed this against beta9. My bad.

          Show
          Nick Williams added a comment - Okay. I see now that he filed this against beta9. My bad.
          Hide
          Ralph Goers added a comment -

          No, this is caused by code I added to fix LOG4J-293 in revision 1519337. This is not a duplicate and needs to be fixed.

          Show
          Ralph Goers added a comment - No, this is caused by code I added to fix LOG4J-293 in revision 1519337. This is not a duplicate and needs to be fixed.
          Hide
          Nick Williams added a comment -

          Because it is. This is caused by the classpath: URI scheme not being recognized. That was reported in LOG4J-293 and fixed in beta9 (not released yet).

          Show
          Nick Williams added a comment - Because it is. This is caused by the classpath: URI scheme not being recognized. That was reported in LOG4J-293 and fixed in beta9 (not released yet).
          Hide
          Ralph Goers added a comment -

          Nick, why did you mark this as a duplicate?

          Show
          Ralph Goers added a comment - Nick, why did you mark this as a duplicate?
          Hide
          Ralph Goers added a comment -

          I just recently added that code to allow a LoggerContext that was created with no configuration to obtain one. It looks like we just need to add another check for a null configLocation being passed in and ignore it if it is.

          Show
          Ralph Goers added a comment - I just recently added that code to allow a LoggerContext that was created with no configuration to obtain one. It looks like we just need to add another check for a null configLocation being passed in and ignore it if it is.
          Hide
          Abhinav Shah added a comment -

          Yes sir.

          Show
          Abhinav Shah added a comment - Yes sir.
          Hide
          Nick Williams added a comment -

          I'm betting this is a web application?

          Show
          Nick Williams added a comment - I'm betting this is a web application?

            People

            • Assignee:
              Ralph Goers
              Reporter:
              Abhinav Shah
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development