Search code examples
log4junboundid-ldap-sdk

How to use unboundid debug log and log4j


need help in integrating unboundid debug logs in log4j.

I understand that Debug class is used to get the unboundid logs , but want to have them in log4j files


Solution

  • Try this:

    static {
        // bridge java.util.Logger output to log4j
        System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
    
        // setting the ldap debug level...
        System.setProperty("com.unboundid.ldap.sdk.debug.enabled", "true");
        System.setProperty("com.unboundid.ldap.sdk.debug.level", "FINEST");
        System.setProperty("com.unboundid.ldap.sdk.debug.type", DebugType.getTypeNameList());
      }