Skip to content

BUG: allows logging config under distributed key#2952

Merged
TomAugspurger merged 3 commits into
dask:masterfrom
deniederhut:bug/2937-logging-config
Apr 27, 2020
Merged

BUG: allows logging config under distributed key#2952
TomAugspurger merged 3 commits into
dask:masterfrom
deniederhut:bug/2937-logging-config

Conversation

@deniederhut

Copy link
Copy Markdown
Contributor

The logging documentation specifies a configuration path to
logging info like config['distributed']['logging'], but the
config module looks in config['logging']. This commit allows
both by looking first in config['distributed'], then falling
back to config.

Closes #2937

The logging documentation specifies a configuration path to
logging info like config['distributed']['logging'], but the
config module looks in config['logging']. This commit allows
both by looking first in config['distributed'], then falling
back to config.

Closes dask#2937
@jakirkham

Copy link
Copy Markdown
Member

@mrocklin, would you be able to review this?

@mrocklin

Copy link
Copy Markdown
Member

I don't think anyone knows much about the logging code here (it may have been Antoine's). @jcrist might be the best person to think about how we can improve the logging/config situation. Perhaps we can ask him?

@mrocklin

mrocklin commented Sep 9, 2019

Copy link
Copy Markdown
Member

poke @jcrist , if you have a minute

(sorry for letting this linger @deniederhut )

@deniederhut

deniederhut commented Sep 12, 2019 via email

Copy link
Copy Markdown
Contributor Author

@jcrist

jcrist commented Sep 12, 2019

Copy link
Copy Markdown
Member

Thanks for the fix @deniederhut. Overall this seems fine to me. Could you add a test that logging configuration is picked up under distributed.logging? The test would go in https://github.com/dask/distributed/blob/master/distributed/tests/test_config.py.

I'm also wondering if we should deprecate/remove the top-level location. It's not clear to me if this was a bug, or legacy from the old config system. My preference would be to at least deprecate it (this could be done in a separate PR), as all distributed config should really be under the distributed key only.

@mrocklin

mrocklin commented Sep 12, 2019 via email

Copy link
Copy Markdown
Member

@deniederhut deniederhut force-pushed the bug/2937-logging-config branch from 5dc243f to 397fc5a Compare September 29, 2019 00:07
@deniederhut

Copy link
Copy Markdown
Contributor Author

Okay, test in place. Should I open an issue for deprecating the older logging config placement? Or just open a second PR that addresses this?

@mrocklin

mrocklin commented Nov 7, 2019

Copy link
Copy Markdown
Member

cc @quasiben for review

@mrocklin

Copy link
Copy Markdown
Member

@jcrist would you be willing to review/manage this PR?

@mrocklin

Copy link
Copy Markdown
Member

Ping @jcrist , who we recently realized wasn't getting github notifications.

@jcrist no pressure (I know I just pinged you on other things as well), but if you have time it would be great to have someone take a long look at how we do logging configuration.

@mrocklin

mrocklin commented Dec 7, 2019

Copy link
Copy Markdown
Member

@jcrist are you planning to look at this? If no, that's fine, but it'd be good to get a response if you're able.

@deniederhut

Copy link
Copy Markdown
Contributor Author

Hey @mrocklin, have we found someone to review this PR?

@mrocklin

Copy link
Copy Markdown
Member

I personally haven't done anything here, no. Is that what you were asking?

@deniederhut

Copy link
Copy Markdown
Contributor Author

No worries! Things have been quiet for a while so I just wanted to check in

@quasiben

quasiben commented Mar 24, 2020

Copy link
Copy Markdown
Member

@deniederhut thanks again for this PR. I merged with master and I hope to get this in today. I think I only have a few questions. Currently, when setting logging config from the CLI the user does something like the following:

❯ DASK_LOGGING__DISTRIBUTED=debug python -c "import dask, distributed; print(dask.config.get('logging'))"
{'distributed': 'debug'}

I was expecting with this PR to be able to be able to use DASK__DISTRIBUTED_LOGGING=debug but this does not seem to work:

❯ DASK__DISTRIBUTED_LOGGING=debug python -c "import dask, distributed; print(dask.config.get('distributed.logging'))"
{'distributed': 'info'}

@jcrist

jcrist commented Apr 22, 2020

Copy link
Copy Markdown
Member

@quasiben, I think you meant:

$ DASK_DISTRIBUTED__LOGGING=debug python -c "import dask, distributed; print(dask.config.get('distributed.logging'))"
debug

which works fine (no __ after DASK is needed, but __ from then on indicate . in the key).

@jcrist

jcrist commented Apr 22, 2020

Copy link
Copy Markdown
Member

Apologies for letting this sit so long. I've kicked off a new build (travis ci only, just to check that things haven't broken while idle). Will merge on tests pass.

@quasiben

Copy link
Copy Markdown
Member

@jcrist thanks for the correction

@TomAugspurger

Copy link
Copy Markdown
Member

All green, merging.

Thanks for sticking with this @deniederhut. Sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logger does not find levels specified in configuration file

7 participants