Events and logs
As dbt runs, it generates events. The most common way to see those events is as log messages, written in real time to two places:
- The command line terminal (
stdout
), to provide interactive feedback while running dbt. - The debug log file (
logs/dbt.log
), to enable detailed debugging of errors when they occur. The text-formatted log messages in this file include allDEBUG
-level events, as well as contextual information, such as log level and thread name. The location of this file can be configured via thelog_path
config.
CLI
21:35:48 6 of 7 OK created view model dbt_testing.name_list......................... [CREATE VIEW in 0.17s]
logs/dbt.log
============================== 2021-12-02 21:29:35.417263 | c83a0afc-7ed3-49e7-8c0e-797af7f9d7b6 ==============================
21:29:35.417263 [info ] [MainThread]: Running with dbt=1.0.0-rc3
21:29:35.417955 [debug] [MainThread]: running dbt with arguments Namespace(cls=<class 'dbt.task.run.RunTask'>, debug=None, defer=None, exclude=None, fail_fast=None, full_refresh=False, log_cache_events=False, log_format=None, partial_parse=None, printer_width=None, profile=None, profiles_dir='/Users/jerco/.dbt', project_dir=None, record_timing_info=None, rpc_method='run', select=None, selector_name=None, send_anonymous_usage_stats=None, single_threaded=False, state=None, static_parser=None, target=None, threads=None, use_colors=None, use_experimental_parser=None, vars='{}', version_check=None, warn_error=None, which='run', write_json=None)
...
21:29:35.814348 [debug] [Thread-1 ]: On model.my_project.my_table: BEGIN
Structured logging
For more details about how the eventing system has been implemented in dbt-core, see the events
module README.
Python interface
danger
The EVENT_HISTORY
object has been deprecated and removed in dbt Core v1.4+
Older versions of dbt-core
made available a full history of events fired during an invocation, in the form of an EVENT_HISTORY
object.
The Python interface into events is significantly less mature than the structured logging interface. For all use cases, we recommend parsing JSON-formatted logs.
0