Hi
I'm using Sigar (native system metrics gathering API) with
log4j-over-slf4j and it crashed on start with:
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)
...
This because the Category class in log4j-over-slf4j (from whom Logger
descends) does not contain the getAllAppenders() method which is a known and
somewhat used hack to test wether log4j was initialized.
I got the project from git and added this mock method to the Category
class:
public Enumeration getAllAppenders() {
return new Enumeration() {
public Object nextElement() {
return null;
}
public boolean hasMoreElements() {
return false;
}
};
}
All works fine now. It would be cool if the main version would support
this.
Btw nice work on slf4j. Got to love open source :))
Regards
David Alves
_______________________________________________
slf4j-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/slf4j-user