Join the Kedro community

Updated 3 days ago

Kedro's Google Cloud Logging Support and Custom Handlers

hi, does kedro support out of the box google cloud logging lib in logging formats? I am not clear on the documentation how advanced adding custom handlers is possible or do I have to do it manually? When would it be better to initialize? After or before kedro loading?

A
d
N
17 comments

ah the logging format in logging.yml seems to be the dictConfig format which can also be used to configure google logger, looks like the answer is yes.

Yeah I think you can just swap the handler!

if you get it running it would be great if you can show us what your config looks like?

There's a catch though:

Note that since CloudLoggingHandler requires an already initialized Client, you must initialize a client and include it in the dictConfig entry for a CloudLoggingHandler.

So it looks like it would be doable with omegaconfigloader hook in that place - does reading logging conf support omegaconf?

Hmm I'm not sure

let me ask the team

did you get an answer? I'll just run a quick check

may be a next week thing

looks like it does not support it

    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'console2'

ValueError: Unable to set formatter '${foo}'

ValueError: Unable to set formatter '${foo:}'

^ attempted to add foo handler to omegaconf

Logging does not support omegaconf out of the box, you can however add additional handler or update it in hooks.

from kedro.framework.project import LOGGING

Does it make sense to update it to enable omegaconf handling of loading that yaml?

We actually went through the opposite path, logging.yml was one of the config type that behaves just like parameters or catalog.

https://github.com/kedro-org/kedro/issues/2426

Add a reply
Sign up and join the conversation on Slack