[
https://issues.jboss.org/browse/JGRP-1879?page=com.atlassian.jira.plugin....
]
ming yue updated JGRP-1879:
---------------------------
Description:
LogFactory suport jdk log,log4j,log4j 2,but useing code like this:
USE_JDK_LOGGER=isPropertySet(Global.USE_JDK_LOGGER);
IS_LOG4J_AVAILABLE=isAvailable("org.apache.log4j.Logger");
IS_LOG4J2_AVAILABLE=isAvailable("org.apache.logging.log4j.core.Logger");
initialize var flag,
the isAvailable function depend on ClassNotFoundException ,when useing log4j 2 Log4j 1.x
bridge, has org.apache.log4j.Logger class ,then exception is not ClassNotFoundException
,change isAvailable cunction to:
protected static boolean isAvailable(String classname) {
try {
return Class.forName(classname) != null;
}
catch(Exception cnfe) {
return false;
}
}
was:
LogFactory suport jdk log,log4j,log4j 2,bug useing
USE_JDK_LOGGER=isPropertySet(Global.USE_JDK_LOGGER);
IS_LOG4J_AVAILABLE=isAvailable("org.apache.log4j.Logger");
IS_LOG4J2_AVAILABLE=isAvailable("org.apache.logging.log4j.core.Logger");
initialize var flag,
the isAvailable function depend on ClassNotFoundException ,when useing log4j 2 Log4j 1.x
bridge, has org.apache.log4j.Logger class ,then exception is not ClassNotFoundException
,change isAvailable to:
protected static boolean isAvailable(String classname) {
try {
return Class.forName(classname) != null;
}
catch(Exception cnfe) {
return false;
}
}
log4j 2 suport error
---------------------
Key: JGRP-1879
URL:
https://issues.jboss.org/browse/JGRP-1879
Project: JGroups
Issue Type: Bug
Affects Versions: 3.4.4, 3.5
Environment: jdk 7
Reporter: ming yue
Assignee: Bela Ban
LogFactory suport jdk log,log4j,log4j 2,but useing code like this:
USE_JDK_LOGGER=isPropertySet(Global.USE_JDK_LOGGER);
IS_LOG4J_AVAILABLE=isAvailable("org.apache.log4j.Logger");
IS_LOG4J2_AVAILABLE=isAvailable("org.apache.logging.log4j.core.Logger");
initialize var flag,
the isAvailable function depend on ClassNotFoundException ,when useing log4j 2 Log4j
1.x bridge, has org.apache.log4j.Logger class ,then exception is not
ClassNotFoundException ,change isAvailable cunction to:
protected static boolean isAvailable(String classname) {
try {
return Class.forName(classname) != null;
}
catch(Exception cnfe) {
return false;
}
}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)