https://dagster.io/ logo
Title
e

Eric Loreaux

03/24/2023, 6:09 PM
How can I get logs from non-ops to show up in dagit? I import a class in my pipeline which sets
logger = logging.getLogger(__file__)
and
logger.setLevel("INFO")
. It then proceeds to log things within its methods using
<http://logger.info|logger.info>()
. However, when I call these methods from my ops, I don't see these logs showing up in the UI
:dagster-bot-responded-by-community: 1
d

Drew You

03/24/2023, 6:17 PM
you might be looking for
<http://context.log.info|context.log.info>
. You need to declare
context
as an argument
e

Eric Loreaux

03/24/2023, 6:18 PM
Thanks Drew, but I'm referring to the logs being generated by imported classes, not my own ops. So I'm not able to update the way these classes are logging information
z

Zach

03/24/2023, 7:03 PM
you might be looking for this doc on capturing python logs
🙌 1