Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-226

Category class in log4j-over-slf4j does not contain getAllAppenders()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.6.x
    • Fix Version/s: None
    • Component/s: log4j-over-slf4j
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      I am running into the same issue discussed here:
      http://slf4j.42922.n3.nabble.com/Sigar-and-log4j-over-slf4j-td2165576.html

      Sigar reports a stack trace like:

      java.lang.NoSuchMethodError: org.apache.log4j.Logger.getAllAppenders()Ljava/util/Enumeration;
      at org.hyperic.sigar.SigarLog.isLogConfigured(SigarLog.java:40)
      at org.hyperic.sigar.SigarLog.getLogger(SigarLog.java:49)
      at org.hyperic.sigar.SigarLog.getLogger(SigarLog.java:44)
      at org.hyperic.sigar.SigarLog.debug(SigarLog.java:60)
      at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:108)

      And it was traced to the absence of getAllAppenders() in log4j-over-slf4j. Adding the missing method addresses the Sigar issue...

      public Enumeration getAllAppenders() {
      return new Enumeration() {
      public Object nextElement()

      { return null; }

      public boolean hasMoreElements()

      { return false; }

      };
      }

      I'm unclear if the above method should be properly implemented, or if the mock stub is sufficient.

        Attachments

          Activity

            People

            Assignee:
            slf4j-dev SLF4J developers list
            Reporter:
            awhitford Anthony Whitford
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: