Class PjdbcDebug

java.lang.Object
org.pjdbc.debug.PjdbcDebug

public final class PjdbcDebug extends Object
Utility class for enabling PJDBC debug output.

Provides a simple API for debugging PJDBC driver behavior:


 // Enable all debug output
 PjdbcDebug.enable();

 // Enable with custom stream
 PjdbcDebug.enable(System.out);

 // Enable only event listener (no JUL logging)
 PjdbcDebug.enableEvents();

 // Enable only JUL logging (no events)
 PjdbcDebug.enableLogging();

 // Disable all
 PjdbcDebug.disable();
 

Can also be enabled via system property:

 java -Dpjdbc.debug=true ...
 
Since:
2.3.0
  • Method Details

    • enable

      public static void enable()
      Enable all debug output (events + JUL logging) to System.err.
    • enable

      public static void enable(PrintStream out)
      Enable all debug output (events + JUL logging) to custom stream.
      Parameters:
      out - the output stream
    • enableEvents

      public static void enableEvents()
      Enable event listener debugging only.
    • enableEvents

      public static void enableEvents(PrintStream out)
      Enable event listener debugging with custom stream.
      Parameters:
      out - the output stream
    • enableLogging

      public static void enableLogging()
      Enable java.util.logging for org.pjdbc at FINE level.
    • disable

      public static void disable()
      Disable all debug output.
    • disableEvents

      public static void disableEvents()
      Disable event listener debugging.
    • disableLogging

      public static void disableLogging()
      Disable java.util.logging.
    • isEnabled

      public static boolean isEnabled()
      Check if debug mode is currently enabled.
      Returns:
      true if any debug output is enabled
    • getDebugInfo

      public static String getDebugInfo()
      Get a summary of PJDBC configuration for debugging.
      Returns:
      multi-line debug info string