-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-738] [Enhancement] dbt debug command not outputting logs correctly #5353
Comments
@UselessAlias Thanks for opening, you're right! The dbt-core/core/dbt/task/debug.py Lines 106 to 111 in 72b6a80
(there's more, that's just a taste) I agree these should be real events (and thereby real logs). I see at least four, though maybe it should be more to better differentiate between success and error:
I'm going to relabel this as an |
AC: Go through and check for all |
Can also remove the method in this test and use |
We may or may not want to leave dbt-core/core/dbt/task/list.py Line 155 in 16f529e
|
A PR for this is up :> Also, I snuck in Emily's suggestion as best I could (required a tiny bit of editing on the "back end") of our test framework. |
@jtcohen6 Seeing your comment, I went through the code of list and did some refactoring for filtering out messages which nets us the following behavior. First command was The structured json logs are info type; just lists the name, no extra messages ahead of time. Achieving this particular behavior requires refactoring some event logger mutations. Is this a good final behavior or would you like to see a different design implemented? ======= per Leah's comment, there remains only the following
|
Is there an existing issue for this?
Current Behavior
When running the command
dbt debug
the logs are not output correctly. When the command is run with json log formatting turned on the log entries are still printed to the console in the same textual way. It also appears they are not output to the logs/dbt.log file either. When--debug
is turned on alongside the json formatter then only the debug level logs are output using the json format.Expected Behavior
It would be good to have the loglines of the debug command output using the json formatter for all levels of logs. We use
dbt debug
as an pre run test to check for any connections issues. We would like to be able to parse the logs for any lines with'level': 'error'
across our entire process, but this connection test doesn't get captured because of the lack of json logging.Steps To Reproduce
Simply run
dbt --log-format=json debug
in any situation. With--debug
included the difference becomes even more apparent.Relevant log output
Environment
What database are you using dbt with?
other (mention it in "Additional Context")
Additional Context
databricks
The text was updated successfully, but these errors were encountered: