denes
08/15/2023, 5:09 PMfrom dagster import Definitions, json_console_logger
from dbt_assets_resources import my_dbt_assets, my_dbt_resource
defs = Definitions(
assets=[my_dbt_assets],
resources={
"dbt_resource": my_dbt_resource,
},
loggers={
"console": json_console_logger
}
)
And then in the UI launchpad I can configure
loggers:
console:
config:
log_level: INFO
name: dbt_logs
However, what if I would like to use it as the default instead of configuring it manually in the UI?rex
08/16/2023, 12:04 AMdenes
08/16/2023, 8:09 AMdefine_asset_job
, but in my understanding thereby I would loose the declarative auto-materialized scheduling of the individual dbt assets. From the docs:
Asset jobs materialize a fixed set of assets each time they runMy understanding is that dbt asset jobs are created automatically in the background, and
context
knows how to log, so what would be needed is a way to let the context of the dbt assets know which logger to use. (Or a way to set a global logger that all assets would honor.)rex
08/16/2023, 11:26 AMowen
08/17/2023, 10:35 PMdefs = Definitions(
assets=[my_dbt_assets],
resources={
"dbt_resource": my_dbt_resource,
},
loggers={
"console": json_console_logger.configured(
{"log_level": "INFO", "name": "dbt_logs"}
)
}
)
this will allow that configuration to be used for all jobs by defaultdenes
08/17/2023, 10:59 PMowen
08/17/2023, 11:05 PMdenes
08/18/2023, 9:28 AM