Skip to content
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

profile config for LOG_FORMAT and LOG_LEVEL #9469

Closed
3 tasks done
dbrtly opened this issue Jan 28, 2024 · 3 comments
Closed
3 tasks done

profile config for LOG_FORMAT and LOG_LEVEL #9469

dbrtly opened this issue Jan 28, 2024 · 3 comments
Labels
enhancement New feature or request wontfix Not a bug or out of scope for dbt-core

Comments

@dbrtly
Copy link
Contributor

dbrtly commented Jan 28, 2024

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

We can set log level and format with extra command line arguments.

To reduce the verbosity, I’d like to set them once in profiles.yml

Describe alternatives you've considered

Adding them to every command.

Who will this benefit?

Users who want more efficient, production-grade logging.

my-warehouse-db:
  target: dev
  outputs:
    dev:
      config:
        log_format: json
        log_level: warn

Or

my-warehouse-db:
  target: dev
  outputs:
    dev:
      config:
        log:
          format: json
          level: warn

and then no need for:

dbt --log-format json --log-level warn run

Are you interested in contributing this feature?

If you can point me in the direction, I’ll give it a shot

Anything else?

No response

@dbrtly dbrtly added enhancement New feature or request triage labels Jan 28, 2024
@jtcohen6 jtcohen6 assigned jtcohen6 and unassigned jtcohen6 Jan 28, 2024
@dbeatty10 dbeatty10 self-assigned this Jan 29, 2024
@dbeatty10
Copy link
Contributor

Thanks for opening @dbrtly!

This is actually already possible -- you'd just do this in your profiles.yml:

Important

These are being deprecated from profiles.yml and moving to dbt_project.yml starting in in dbt-core 1.8.

See dbt-labs/docs.getdbt.com#4814 for in-progress documentation updates

# profiles.yml

config:
  log_format: json
  log_level: info

  # # or these configs which apply ONLY to the log file
  # log_format_file: json
  # log_level_file: info

my-warehouse-db:
  target: dev
  outputs:
    dev:
    # ...

Environment variables

You can also use any of these environment variables instead of profiles.yml or their associated CLI flags (--log-format, --log-format-file, --log-level , --log-level-file):

  • DBT_LOG_FORMAT
  • DBT_LOG_FORMAT_FILE
  • DBT_LOG_LEVEL
  • DBT_LOG_LEVEL_FILE

Summary

Since this is already possible we're going to close this in favor of these documentation updates:

@dbeatty10 dbeatty10 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2024
@dbeatty10 dbeatty10 added wontfix Not a bug or out of scope for dbt-core and removed triage labels Jan 29, 2024
@dbeatty10 dbeatty10 removed their assignment Jan 29, 2024
@dbrtly
Copy link
Contributor Author

dbrtly commented Jan 29, 2024

Thanks for clarifying. This functionality was unclear to me by reading the documentation alone.

@dbeatty10
Copy link
Contributor

Thanks for clarifying. This functionality was unclear to me by reading the documentation alone.

Sure thing, @dbrtly 👍

We'll try to make some updates to the documentation so that the different options are more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix Not a bug or out of scope for dbt-core
Projects
None yet
Development

No branches or pull requests

3 participants