Documentation Home
MySQL Connector/J 5.1 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb
HTML Download (TGZ) - 131.1Kb
HTML Download (Zip) - 150.3Kb


5.3.6 Debugging/Profiling

  • logger

    The name of a class that implements "com.mysql.jdbc.log.Log" that will be used to log messages to. (default is "com.mysql.jdbc.log.StandardLogger", which logs to STDERR)

    Default Value com.mysql.jdbc.log.StandardLogger
    Since Version 3.1.1
  • gatherPerfMetrics

    Should the driver gather performance metrics, and report them via the configured logger every 'reportMetricsIntervalMillis' milliseconds?

    Default Value false
    Since Version 3.1.2
  • profileSQL

    Trace queries and their execution/fetch times to the configured 'profilerEventHandler'

    Default Value false
    Since Version 3.1.0
  • profileSql

    Deprecated, use 'profileSQL' instead. Trace queries and their execution/fetch times on STDERR (true/false) defaults to 'false'

    Since Version 2.0.14
  • reportMetricsIntervalMillis

    If 'gatherPerfMetrics' is enabled, how often should they be logged (in ms)?

    Default Value 30000
    Since Version 3.1.2
  • maxQuerySizeToLog

    Controls the maximum length of the part of a query that will get logged when profiling or tracing

    Default Value 2048
    Since Version 3.1.3
  • packetDebugBufferSize

    The maximum number of packets to retain when 'enablePacketDebug' is true

    Default Value 20
    Since Version 3.1.3
  • slowQueryThresholdMillis

    If 'logSlowQueries' is enabled, how long should a query take (in ms) before it is logged as slow?

    Default Value 2000
    Since Version 3.1.2
  • slowQueryThresholdNanos

    If 'logSlowQueries' is enabled, 'useNanosForElapsedTime' is set to true, and this property is set to a non-zero value, the driver will use this threshold (in nanosecond units) to determine if a query was slow.

    Default Value 0
    Since Version 5.0.7
  • useUsageAdvisor

    Should the driver issue 'usage' warnings advising proper and efficient usage of JDBC and MySQL Connector/J to the 'profilerEventHandler'?

    Default Value false
    Since Version 3.1.1
  • autoGenerateTestcaseScript

    Should the driver dump the SQL it is executing, including server-side prepared statements to STDERR?

    Default Value false
    Since Version 3.1.9
  • autoSlowLog

    Instead of using slowQueryThreshold* to determine if a query is slow enough to be logged, maintain statistics that allow the driver to determine queries that are outside the 99th percentile?

    Default Value true
    Since Version 5.1.4
  • clientInfoProvider

    The name of a class that implements the com.mysql.jdbc.JDBC4ClientInfoProvider interface in order to support JDBC-4.0's Connection.get/setClientInfo() methods

    Default Value com.mysql.jdbc.JDBC4CommentClientInfoProvider
    Since Version 5.1.0
  • dumpMetadataOnColumnNotFound

    Should the driver dump the field-level metadata of a result set into the exception message when ResultSet.findColumn() fails?

    Default Value false
    Since Version 3.1.13
  • dumpQueriesOnException

    Should the driver dump the contents of the query sent to the server in the message for SQLExceptions?

    Default Value false
    Since Version 3.1.3
  • enablePacketDebug

    When enabled, a ring-buffer of 'packetDebugBufferSize' packets will be kept, and dumped when exceptions are thrown in key areas in the driver's code

    Default Value false
    Since Version 3.1.3
  • explainSlowQueries

    If 'logSlowQueries' is enabled, should the driver automatically issue an 'EXPLAIN' on the server and send the results to the configured logger at a WARN level?

    Default Value false
    Since Version 3.1.2
  • includeInnodbStatusInDeadlockExceptions

    Include the output of "SHOW ENGINE INNODB STATUS" in exception messages when deadlock exceptions are detected?

    Default Value false
    Since Version 5.0.7
  • includeThreadDumpInDeadlockExceptions

    Include a current Java thread dump in exception messages when deadlock exceptions are detected?

    Default Value false
    Since Version 5.1.15
  • includeThreadNamesAsStatementComment

    Include the name of the current thread as a comment visible in "SHOW PROCESSLIST", or in Innodb deadlock dumps, useful in correlation with "includeInnodbStatusInDeadlockExceptions=true" and "includeThreadDumpInDeadlockExceptions=true".

    Default Value false
    Since Version 5.1.15
  • logSlowQueries

    Should queries that take longer than 'slowQueryThresholdMillis' or detected by the 'autoSlowLog' monitoring be reported to the registered 'profilerEventHandler'?

    Default Value false
    Since Version 3.1.2
  • logXaCommands

    Should the driver log XA commands sent by MysqlXaConnection to the server, at the DEBUG level of logging?

    Default Value false
    Since Version 5.0.5
  • profilerEventHandler

    Name of a class that implements the interface com.mysql.jdbc.profiler.ProfilerEventHandler that will be used to handle profiling/tracing events.

    Default Value com.mysql.jdbc.profiler.LoggingProfilerEventHandler
    Since Version 5.1.6
  • resultSetSizeThreshold

    If 'useUsageAdvisor' is true, how many rows should a result set contain before the driver warns that it is suspiciously large?

    Default Value 100
    Since Version 5.0.5
  • traceProtocol

    Should the network protocol be logged at the TRACE level?

    Default Value false
    Since Version 3.1.2
  • useNanosForElapsedTime

    For profiling/debugging functionality that measures elapsed time, should the driver try to use nanoseconds resolution if available (JDK >= 1.5)?

    Default Value false
    Since Version 5.0.7