Has anyone been successful redirecting other logge...
# ask-community
s
Has anyone been successful redirecting other loggers into the dagster logger? I'd love some pointers.
dagster bot answered by content 1
c
Hi Stephen. It is possible to redirect logs from your custom python logs to the dagster logger, by doing something like this: https://docs.dagster.io/concepts/logging/python-logging#capturing-python-logs-
s
Hi @claire: thanks for the help. does this only work if you instantiate your logger inside an op? It doesn't seem to work when the logger is instantiated inside an external python module. is that expected?
c
Hi Stephen, I believe that loggers instantiated via
logger.getLogger
are global, so it should work if the logger is also instantiated in an external python module. Though, logs logged via external loggers are only captured within op execution, I don't believe they capture logs outside of op/asset execution
s
cool. thanks!!! 😉
@claire: can you point me to some docs on the proper syntax for getting this into cloudbuild.yaml files? Thanks.