Skip to main content

Logs

Log Formatting

The LOG_FORMAT config specifies how dbt's logs should be formatted. If the value of this config is json, dbt will output fully structured logs in JSON format; otherwise, it will output text-formatted logs that are sparser for the CLI and more detailed in logs/dbt.log.

Usage
dbt --log-format json run
{"code": "A001", "data": {"v": "=1.0.0"}, "invocation_id": "1193e449-4b7a-4eb1-8e8e-047a8b3b7973", "level": "info", "log_version": 1, "msg": "Running with dbt=1.0.0", "node_info": {}, "pid": 35098, "thread_name": "MainThread", "ts": "2021-12-03T10:46:59.928217Z", "type": "log_line"}
Tip: verbose structured logs

Use json formatting value in conjunction with the DEBUG config to produce rich log information which can be piped into monitoring tools for analysis:

dbt --debug --log-format json run

See structured logging for more details.

Debug-level logging

The DEBUG config redirects dbt's debug logs to standard output. This has the effect of showing debug-level log information in the terminal in addition to the logs/dbt.log file. This output is verbose.

The --debug flag is also available via shorthand as -d.

Usage
dbt --debug run
...

Suppress non-error logs in output

By default, dbt shows all logs in standard out (stdout). You can use the QUIET config to show only error logs in stdout. Logs will still include the output of anything passed to the print() macro. For example, you might suppress all but error logs to more easily find and debug a jinja error.

profiles.yml
config:
quiet: true

Supply the -q or --quiet flag to dbt run to show only error logs and suppress non-error logs.

dbt --quiet run
...

0