Log4j 2
  1. Log4j 2
  2. LOG4J2-80

level not tested when slf4j-impl and org.slf4j:jcl-over-slf4j

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha2
    • Fix Version/s: 2.0-beta1
    • Component/s: None
    • Labels:
      None

      Description

      My use case is my application use slf4j as a logging. I wanted to move to slf4 impl using log4j2.
      The application contains some frameworks (spring) which use commons-logging so as I use org.slf4j:jcl-over-slf4j.
      But in such case all level pass and configuration is not used. You can imagine what happen with org.springframework when debug is activated

      1. LOG4J2-80.patch
        1 kB
        Olivier Lamy (*$^¨%`£)

        Activity

        Hide
        Olivier Lamy (*$^¨%`£) added a comment - - edited

        patch.
        Note upgrade to slf4j 1.7.0 included.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - - edited patch. Note upgrade to slf4j 1.7.0 included.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        updating status as it's bit blocker for folks with such use case.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - updating status as it's bit blocker for folks with such use case.
        Hide
        Ralph Goers added a comment -

        Oliver. Can you remove jcl-over-slf4j and replace that with the jcl-bridge (org.apache.logging.log4j:log4j-jcl) and see if that fixes your problem? I'm testing in an environment that uses Spring, SLF4J, Commons Logging and Log4j 2 and that seems to work for me. However, I will look at your patch.

        I tested with SLF4J 1.7.0 yesterday and found no issues.

        Show
        Ralph Goers added a comment - Oliver. Can you remove jcl-over-slf4j and replace that with the jcl-bridge (org.apache.logging.log4j:log4j-jcl) and see if that fixes your problem? I'm testing in an environment that uses Spring, SLF4J, Commons Logging and Log4j 2 and that seems to work for me. However, I will look at your patch. I tested with SLF4J 1.7.0 yesterday and found no issues.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        but with this solution I will have commons-logging:commons-logging as a dependency.
        I'd like to avoid that.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - but with this solution I will have commons-logging:commons-logging as a dependency. I'd like to avoid that.
        Hide
        Ralph Goers added a comment -

        I applied the patch in revision 1382110. However, I should warn you that you may have an issue when using the ClassLoaderContextSelector because it will use the ClassLoader for jcl-over-slf4j, not the caller of commons-logging.

        Show
        Ralph Goers added a comment - I applied the patch in revision 1382110. However, I should warn you that you may have an issue when using the ClassLoaderContextSelector because it will use the ClassLoader for jcl-over-slf4j, not the caller of commons-logging.
        Hide
        Ralph Goers added a comment -

        Please verify and close.

        Show
        Ralph Goers added a comment - Please verify and close.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        Thanks for the comment on classloader.
        Even if you apply the patch, I will try org.apache.logging.log4j:log4j-jcl (I have a bit of exclusions to do first ).
        Thanks!

        Show
        Olivier Lamy (*$^¨%`£) added a comment - Thanks for the comment on classloader. Even if you apply the patch, I will try org.apache.logging.log4j:log4j-jcl (I have a bit of exclusions to do first ). Thanks!

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Olivier Lamy (*$^¨%`£)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development