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

[CT-1550] Make log format specification more flexible #6312

Closed
gshank opened this issue Nov 23, 2022 · 4 comments
Closed

[CT-1550] Make log format specification more flexible #6312

gshank opened this issue Nov 23, 2022 · 4 comments
Labels

Comments

@gshank
Copy link
Contributor

gshank commented Nov 23, 2022

We are in the process of changing the logging system to be less dependent on global variables and more self-contained, and also to make specifying custom log managers possible.

Right now we can only set one "log_format" which applies to both the stdout logger and the file logger. In this new logging world we will almost certainly want to be able to be more granular in settings for the loggers. For example, it seems desirable to enable people to use the text logger for stdout and the json logger for the file log. Once we implement a way to produce protobuf logs, people will probably not want to send those binary logs to stdout.

It's an open question about how these configs should be implemented. At the very least we would want to differentiate log formats for existing loggers. But it also feels like we might want to be able to configure different logging output to custom loggers without resorting to Python code.

@github-actions github-actions bot changed the title Make log format specification more flexible [CT-1550] Make log format specification more flexible Nov 23, 2022
@DustinMoriarty
Copy link

We need this as well. Right now there is no way to turn off logging to the file system. We need to be able to run DBT without write access to the file system for a couple reasons.

  1. With the python models, we need to be able to make sure that people are not storing data in the file system. We want to deny the DBT user file system access.
  2. File system logging is unnecessary and inefficient. We just need logging to stderr like every other application we put in a container.

Regardless, the whole point of python logging is to leave decisions about logging configuration up to the user. We need a way to provide our own logging configuration. A --log-config-file variable would meet this use case perfectly.

@jtcohen6
Copy link
Contributor

Another related issue: #6615

@jtcohen6
Copy link
Contributor

@DustinMoriarty To your points:

Python model code is shipped up to run remotely in your data warehouse/platform. It isn't possible to access the same file system as the dbt project, unless you're connecting to a data processing engine that runs within the local process (e.g. fal, DuckDB).

Regardless, the whole point of python logging is to leave decisions about logging configuration up to the user. We need a way to provide our own logging configuration.

In v1.4, we have implemented a much more flexible EventManager that should allow programmatic invokers of dbt-core to configure as they want, and register their own custom callbacks if desired. While programmatic invocations (via Python API) are not yet officially supported, we're planning to get this ready for the v1.5 release in April.

@nathaniel-may
Copy link
Contributor

closing in favor of #6639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants