Replies: 2 comments 2 replies
-
I lean towards the option "Option: Independent Raw and Structured Logs - Python Logging Integration" - we use the standard python logging so either option 2 or 3 would work. I'm not sure how prevalent logging to standard out is (not via a logging handler) |
Beta Was this translation helpful? Give feedback.
-
I'm highly in favor of enforcing the Python logging standard with option 2. Option 3 seems to add implementation complexity for a feature that will not be very used. This feature is important to make it easy to port existing Python projects to Dagster. Having to rewrite or duplicate your logging to be able to see it in Dagit worsens the experience of a new user. |
Beta Was this translation helpful? Give feedback.
-
The Problem
Dagster expects developers to go to the structured log viewer to see logs for the code that executes inside their solids. If a developer wants to get a record to show up in the structured log viewer, they need to invoke context.log. This causes some problems:
context.log
.context.
) every time you want to log something.Use the Python logging API instead of our custom context loggers is our 7th-most upvoted Github issue.
Potential Solutions
So what do we do? Ultimately a logging system needs to answer two questions:
Option: Raw Logs
In this world, logs are unstructured text, captured per process. Users log by writing to stdout, and they access their logs from an interface that looks like the current “Raw Step Logs” interface.
Pros
Cons
Required Changes
Option: Independent Raw and Structured Logs - Python Logging Integration
In this world, some logs have structure. We have separate views for the structured logs and the unstructured logs. Users are encouraged to log by using the Python logging library, which will result in entries in the structured log.
Pros:
Cons
Required Changes:
Option: Interleaved Raw and Structured Logs
In this world, some logs have structure. We provide a single Dagit view that interleaves the structured logs and the unstructured logs.
Pros
Cons
load_input
returns in between when a user writes to stdout and when stdout is flushed, then we could misattribute a print statement to the solid body instead ofload_input
. Placing markers in the raw logs could potentially address this issue.Required Changes
Beta Was this translation helpful? Give feedback.
All reactions