Salesforce

Enabling JDBC Driver Debugging in DBeaver

« Go Back

Information

 
SummaryThis article provides step by step instructions to help you configure debugging for the Snowflake JDBC driver in DBeaver using Java core logging facilities.
Last Modified DateSeptember 27, 2024
Solution
Instructions:

1.) Locate the dbeaver.ini file using the default locations below:

MacOS:
/Applications/DBeaver.app/Contents/Eclipse/dbeaver.ini

Windows:
C:\Program Files\DBeaver\dbeaver.ini

Linux:
/usr/share/dbeaver/dbeaver.ini
 
2.) Edit the dbeaver.ini file to add the following JVM argument under the --vmargs section:
 
-vmargs

...

-Dnet.snowflake.jdbc.loggerImpl=net.snowflake.client.log.JDK14Logger

3.) Save the .ini file. Restart the Dbeaver application and initiate a new connection to Snowflake from Dbeaver. You should see the log file generated at the default location specified by java.io.tmpDir

java.io.tmpDir default path based on OS

MacOS and Linux:
/var/tmp

Windows:
C:\temp


The above steps are sufficient to generate the logs. However if you need more controls over logging. Please follow the below steps.

1.) Create a file logging.properties with the below content. Modify "java.util.logging.FileHandler.pattern" if you want the log files to be generated in a different path.

###########################################################
#   Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################

############################################################
#   Global properties
############################################################

# "handlers" specifies a comma-separated list of log Handler
# classes.  These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# ConsoleHandler and FileHandler are configured here such that
# the logs are dumped into both a standard error and a file.
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers.  For any given facility this global level
# can be overriden by a facility specific level.
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level = ALL

############################################################
# Handler specific properties.
# Describes specific configuration information for Handlers.
############################################################

# default file output is in the tmp dir
java.util.logging.FileHandler.pattern = C:\\temp\\logs\\snowflake_jdbc%u.log 
java.util.logging.FileHandler.limit = 5000000000000000
java.util.logging.FileHandler.count = 10
java.util.logging.FileHandler.level = ALL 
java.util.logging.FileHandler.formatter = net.snowflake.client.log.SFFormatter

# Limit the messages that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = net.snowflake.client.log.SFFormatter

# Example to customize the SimpleFormatter output format
# to print one-line log message like this:
#     <level>: <log message> [<date/time>]
#
# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n

############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

# Snowflake JDBC logging level.
net.snowflake.level = ALL # If you want to enable the DEBUG logs, replace INFO with ALL.
net.snowflake.handler = java.util.logging.FileHandler

2. Edit the dbeaver.ini file to add the following JVM argument under the --vmargs section. Add an additional parameter along with the one shared earlier -Djava.util.logging.config.file specifying the path where the logging.properties file is present.
 

-vmargs

...

-Dnet.snowflake.jdbc.loggerImpl=net.snowflake.client.log.JDK14Logger
-Djava.util.logging.config.file=C:\\Program Files\\DBeaver\\jarfiles\\logging.properties


3. Save the .ini files. Restart the Dbeaver Application and initiate a connection to Snowflake. This generates the JDBC driver logs in the path C:\temp\logs\

TLS Debug Logging
1. To enable TLS debug logging for DBeaver, add the following at the end of the dbeaver.ini file.

-Djavax.net.debug=all

2. Save the file and restart DBeaver.
3. The DBeaver debug log in the following location:

 <USER_HOME>/Library/DBeaverData/workspace6/.metadata
The log file is called:
dbeaver-debug.log


If you are unable to locate the dbeaver-debug.log file, please refer to the DBeaver documentation
https://dbeaver.com/docs/wiki/Log-files/

Additional Information
URL NameEnabling-JDBC-Driver-Debugging-in-DBeaver
TitleEnabling JDBC Driver Debugging in DBeaver
CategoryClient Connectivity & Functionality
Sub CategoryJDBC
Article Record TypeFAQ

Powered by