Matt Menzenski
03/16/2023, 9:50 PMmeltano invoke dbt-redshift build, and I’m trying to use JSON logs for everything.
For Meltano, I am using this logging.yaml file:
version: 1
disable_existing_loggers: false
formatters:
json:
(): meltano.core.logging.json_formatter
handlers:
console:
class: logging.StreamHandler
formatter: json
stream: <ext://sys.stderr>
root:
level: INFO
propagate: 'yes'
handlers:
- console
And I’m setting the following environment variables:
DBT_LOG_FORMAT=json
MELTANO_CLI_LOG_CONFIG=logging.yaml
When I run the dbt build command, I see what I assume are the “base/core” Meltano logs in JSON, but the dbt-ext logs appear to be plain text:
{"event": "Environment 'dev' is active", "level": "info", "timestamp": "2023-03-16T19:42:37.438401Z"}
Extension executing `dbt build`...
// dbt logs here
{"data": {"stats": {"error": 2, "pass": 27, "skip": 79, "total": 108, "warn": 0}}, "info": {"category": "", "code": "Z023", "extra": {}, "invocation_id": "466818
61-5c2b-4a14-a23e-2aefd0916c9a", "level": "info", "msg": "Done. PASS=27 WARN=0 ERROR=2 SKIP=79 TOTAL=108", "name": "StatsLine", "pid": 23, "thread": "MainThread"
, "ts": "2023-03-16T19:45:46.479849Z"}}
error invoking dbt None error_message=dbt invocation failed returncode=1
time="2023-03-16T19:45:48 UTC" level=info msg="sub-process exited" argo=true error="<nil>"
Error: exit status 1
Is there another thing I need to do to enable JSON logging in the dbt-ext extension?