Logging
All Volt components expose logging capabilities which can produce extensive diagnostic information for use in troubleshooting and debugging scenarios.
Environment variables
The logging mode and verbosity is controlled via two environment variables.
The TDXVOLT_LOG_LEVEL
environment variable configures the overall logging mode, and can take either ERROR
or DEBUG
values. The default value, if no environment variable is found, is dependent on the build mode - see below.
The TDXVOLT_LOG_DEBUG
environment variable can be used to control the verbosity of output when using the DEBUG
log level. This variable can take various values as indicated in the table below:
value | description |
---|---|
all | All components emit output. |
client | C++ client library components. |
core | The Volt core components. |
crypto | All cryptographic-related output. |
database | Output related to the Volt meta-database. This can be quite noisy. |
fusebox | Fusebox-specific debug output. |
grpc-client | Client-side grpc diagnostics. |
grpc-server | Server-side grpc diagnostics. |
perfomance | Performance and timing data across the platform. |
policy | Policy evaluation diagnostics, this can be quite noisy. |
qml | Diagostics originating from QML code. This is only used by the fusebox. |
The TDXVOLT_LOG_DEBUG
variable can be used to pick and mix output from various debug components. A component can be omitted from the output by prefixing the name with a minus sign.
If the TDXVOLT_LOG_DEBUG
variable is unset and TDXVOLT_LOG_LEVEL
is set to DEBUG
then by default all component output is generated, which is equivalent to TDXVOLT_LOG_DEBUG=all
.
Note that the `TDXVOLT_LOG_DEBUG` variable only affects `DEBUG` output. The `ERROR` output will be generated for all components irrespective of the value of `TDXVOLT_LOG_DEBUG`.
Release builds
The default log level for release builds is ERROR
, and the output is written to a file in the ~/Documents/tdxVolt/logs
folder, or equivalent depending on the OS.
The log output is never written to STDOUT when using release builds.
The log level can be increased to DEBUG
via the TDXVOLT_LOG_LEVEL
environment variable, and similarly the TDXVOLT_LOG_DEBUG
variable can be used to configure the verbosity of the various components, as outlined above.
Debug builds
The default log level for debug builds is DEBUG
, and the output is written to STDOUT, as well as a file in the ~/Documents/tdxVolt/logs
folder, or equivalent depending on the OS.
The default verbosity level all
, so all components will output debug information.
GRPC
It is possible to enable grpc logging in addition to that of the Volt. This can be done using the GRPC_VERBOSITY
and GRPC_TRACE
environment variables, see this document for more information.