mlflow / mlflow

Open source platform for the machine learning lifecycle
https://mlflow.org
Apache License 2.0
18.4k stars 4.16k forks source link

[FR] Configure MLFlow logging level using an environment variable #13216

Open Flametaa opened 5 days ago

Flametaa commented 5 days ago

Willingness to contribute

Yes. I can contribute this feature independently.

Proposal Summary

I would like to be able to configure default MLFlow logging level in scripts using an environment variable, rather than fetching the mlflow logger and setting the level using python as defined in https://mlflow.org/docs/latest/python_api/index.html#log-levels.

Motivation

What is the use case for this feature?

I want to inject this configuration by default in all MLFlow scripts so that the users will have a default configuration that is defined by the admins.

Why is this use case valuable to support for MLflow users in general?

Centralizing configuration in environment variables will make it easier to enforce standardization and to easily configure MLFlow features.

Why is this use case valuable to support for your project(s) or organization?

This will allow us to define the MLFlow logging level in all projects by injecting the variables by default in MLFlow scripts

Why is it currently difficult to achieve this use case?

Users currently have to define the logging level manually in every script as defined in https://mlflow.org/docs/latest/python_api/index.html#log-levels. The logging level defaults to info which logs a lot of unnecessary information when we are executing the script in a non interactive environment.

Details

No response

What component(s) does this bug affect?

What interface(s) does this bug affect?

What language(s) does this bug affect?

What integration(s) does this bug affect?

B-Step62 commented 4 days ago

Hi @Flametaa, the proposal makes sense to me! Would you be interested in opening a PR for this feature? Here are some pointers to get started: