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

org.apache.logging.log4j.Logger lacks some log(Level, String, ...) method

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta3
    • None
    • API

    Description

      Hello,
      I dont know if Im not alone with this problem but I encountered blocker in Log4j2 usage (blocker for me personally of course ). Im posting it as Wish issue as it is not a bug.

      Im trying to switch from Log4j 1.2 to 2 and it looked like piece of cake but - I have developped some logging facade or wrapper solution around log4j 1.2, it's something like simple SLF4J, it was necessary because my project logging needs are pretty special and also I wanted to have the option to easilly switch logging frameworks.

      Problem is that most of my logging code is in own abstract class that is common for all implementations, concrete implementations are extending this base and have to implement only few methods like log(Level, String) and isLevelLoggable(Level) etc.. The advantage is that implementations are very simple to write with minimal amount of copy/paste programming.

      Problem is that the new org.apache.logging.log4j.Logger iface does not contain any log(...) method and Im stuck.

      I have only 2 options - I can use org.apache.logging.log4j.core.Logger class without using iface but I dont want that for obvious reasons - I want to do it properly. Second option is to implement all info(), debug(),trace(),.... methods in my implementation class but I dont wanna do that because that is exactly what I wanted to avoid in my facade solution.

      I know it's my wish only, I dont know if this change had some good reasons but Im voting for adding some log() method to Logger iface The same thing applies for missing getLevel() method but I already solved this one easilly so it's not my priority.

      Thanks,
      Pavel

      Attachments

        1. customFacade.zip
          6 kB
          Pavel Trka
        2. custom.zip
          15 kB
          Ralph Goers

        Activity

          People

            Unassigned Unassigned
            pavel.trka@gmail.com Pavel Trka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: