In most software, including Dremio, DEBUG logging provides information about code steps that are normally not printed to the log. In Dremio, logging is built on the popular Logback framework, and uses the ../conf/logback.xml
file to control the logging for the main Dremio process.
The logback.xml
file can be edited to log more details to the server.log file for Dremio.
This article will cover the changes needed to enable DEBUG logging for on-prem/self-managed Dremio application and plugins running in the Dremio Java process, such as source connector plugins or other libraries.
Applies to:
Any on-premise or self-managed Dremio deployment.
Changing logging settings for Dremio code in the Dremio process
-
Locate the
logback.xml
file in theconf/
for your Dremio server(s.) -
Using a file editor, open the file. It will look roughly like this:
<?xml version="1.0" encoding="UTF-8" ?> <!-- Copyright (C) 2017-2019 Dremio Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--> <configuration> <turboFilter> class="com.dremio.common.logging.obfuscation.BlockLogLevelTurboFilter <defaultLogLevelThreshold> INFO </defaultLogLevelThreshold>. <packageLogLevel> com.dremio,DEBUG </packageLogLevel> </turboFilter> <contextListener> class="ch.qos.logback.classic.jul.LevelChangePropagator"/> <appender> name="console" class="ch.qos.logback.core.ConsoleAppender" <encoder> <pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg%n </pattern> </encoder> </appender> ... (more XML about dremio logging)```
-
If you see the
<turboFilter>
XML opener, you may delete it. To do so, simply remove all the lines in between the<turboFilter>
and</turboFilter>
lines, and optionally the lines themselves, then save the change. -
Once the
turboFilter
is removed and the file is saved, you can move down the file to find an XML block like this:<logger name="com.dremio"> <level value="${dremio.log.level:-info}"/> </logger>
This XML block controls the level of logging that code from the Java package com.dremio
should emit to the logging framework. The hyphen prefixing the info
in
${dremio.log.level:-info
has a special meaning of "unless otherwise specified, print at
<level>
. So, this line will make Dremio code print at INFO unless another logger such as the
“root logger” is printing at DEBUG or TRACE levels.
5. To enable debug logging for the com.dremio
code, edit the word info
in the blog to the
word debug
and save the file.
6. If you have previously followed the steps to configure dynamic logging configuration in Dremio,
no further action is needed. The new log level will begin printing on the next configuration check.
If you do not have dynamic logging configuration enabled, you will need to restart the node for
the changes to take effect.
Changing logging settings for ALL code running in the Dremio process
If you want to enable DEBUG logging for all code running in the Dremio JVM, and not just code from the com.dremio
packages, follow steps 1-3 above to find and open the logback.xml with an editor, and removing the turboFilter
if present. This will generate a lot of logging very quickly so it’s not recommended to leave the system running in this state when not actively investigating a problem or behavior.
After opening the file in an editor:
- Navigate in the file to find a block like this:
<root> <level value="${dremio.log.root.level:-error}"/> <if condition='isDefined("dremio.log.path")'> <then> <appender-ref ref="text"/> <appender-ref ref="json"/> </then> <else> <appender-ref ref="console"/> </else> </if> </root>
- To change all logging output to DEBUG level, change
error
in the line<level value="${dremio.log.root.level:-error}"/>
todebug
and save the file. - If you have dynamic logging configured the change will take effect on the next configuration scan. If not, you will need to restart Dremio for the change to take effect.
Changing logging settings for specific packages of code running in the Dremio process
If you want to enable advanced logging for any specific code packages, or to narrow down the code classes in the com.dremio
package that log at DEBUG (or TRACE) levels you can add specific logger blocks similar to the Dremio package logger mentioned above.
To do this, you need to add a new logger block with the package or class, and the desired logging level you want to print from that software.
Here is an example to enable logging from the Amazon AWS Client SDK used for some plugins in Dremio:
<logger name="software.amazon.awssdk">
<level value="debug"/>
</logger>
This block can be added anywhere in the <configuration>
XML block in the logback.xml
.
Further Reading
You can learn more about customizing and configuring Logback files here: https://logback.qos.ch/index.html
You can learn more about reading a stack trace to identify a code package here: What is a stack trace, and how can I use it to debug my application errors?