Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1879

log4j 2 suport error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 3.6
    • 3.4.4, 3.5
    • None
    • Release Notes

      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; }

      }

              rhn-engineering-bban Bela Ban
              yuedaxia_jira ming yue (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: