Documentation Home
MySQL Connector/J Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.8Mb
PDF (A4) - 0.8Mb


6.3.14 Debugging/Profiling

  • logger

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

    Default Value com.mysql.cj.log.StandardLogger
    Since Version 3.1.1
  • profilerEventHandler

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

    Default Value com.mysql.cj.log.LoggingProfilerEventHandler
    Since Version 5.1.6
  • useNanosForElapsedTime

    For profiling/debugging functionality that measures elapsed time, should the driver try to use nanoseconds resolution?

    Default Value false
    Since Version 5.0.7
  • 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
  • maxByteArrayAsHex

    Maximum size for a byte array parameter in a prepared statement that is converted to a hexadecimal literal when interpolated by 'JdbcPreparedStatement.toString()'. Any byte arrays larger than this value are interpolated generically as "** BYTE ARRAY DATA **".

    Default Value 1024
    Since Version 8.0.31
  • profileSQL

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

    Default Value false
    Since Version 3.1.0
  • 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
  • slowQueryThresholdMillis

    If 'logSlowQueries' is enabled, how long, in milliseconds, should a query take 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
  • 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
  • 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
  • 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
  • reportMetricsIntervalMillis

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

    Default Value 30000
    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
  • traceProtocol

    Should the network protocol be logged at the TRACE level?

    Default Value false
    Since Version 3.1.2
  • 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
  • packetDebugBufferSize

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

    Default Value 20
    Since Version 3.1.3
  • 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
  • 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
  • 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
  • openTelemetry

    Should the driver generate OpenTelemetry traces and handle context propagation to the MySQL Server? This option accepts the values "REQUIRED", "PREFERRED", and "DISABLED". If set to "REQUIRED", an OpenTelemetry library must be available at run time, or connections to the MySQL Server will fail. Setting it to "DISABLED" turns off generating OpenTelemetry instrumentation by Connector/J. Setting it to "PREFERRED" enables generating OpenTelemetry instrumentation provided that an OpenTelemetry library is available at run time, and a warning is issued otherwise. Not setting a value for the property is equivalent to setting it as "PREFERRED", but no warning is issued when no OpenTelmetry library is available at run time. Connector/J relies entirely on the OpenTelemetry exporters configured in the calling application and does not provide any means of configuring its own exporters.

    Default Value PREFERRED
    Since Version 8.4.0