Standardizing logging configuration in Dagster #12495
Replies: 8 comments 8 replies
-
Thanks for starting this discussion! Another area I'd love to see included is the ability to better send logs from Dagster to additional handlers, and filter them along the way. I think exposing a more standard interface to logging configuration meshes with this. Existing issues:
And, some improved scalability with |
Beta Was this translation helpful? Give feedback.
-
Just throwing a comment in here to advocate for an enhancement on customizing logging in Dagster internals. Our use case is that we would like to export logs created by Daemons to Datadog for monitoring + alerting purposes. At a bare minimum it would be a huge win if we could simply export the logs in JSON format. Thanks! |
Beta Was this translation helpful? Give feedback.
-
There have been several releases since this discussion and since the related issues have last been updated. Could we get a progress/planning update on this, please? |
Beta Was this translation helpful? Give feedback.
-
Any update on this? So far the only solution we have found is to manually set a custom logger for all our jobs. |
Beta Was this translation helpful? Give feedback.
-
Would also love to understand if there are planning updates here. To describe our use case - we also use DataDog for monitoring, and the inability to globally override how Dagster system logs (in particular, error log stack traces) are formatted has been a big usability pain point for developers. (I've spoken to some folks on the Dagster side about this on slack as well, but I want to tie that together with this more centralized thread) |
Beta Was this translation helpful? Give feedback.
-
Any updates here? Logging with anything except the default loggers is still a huge pain, especially if you want global configuration. Also I'm not seeing an obvious way to pass loggers for assets and asset jobs - there's logger_defs for op-jobs, but I don't see anything similar for assets / asset jobs. Has anyone figured out how to provide custom loggers for assets? |
Beta Was this translation helpful? Give feedback.
-
So far I've been using this hack to be able to log to dagster console and use our own custom logger (which forwards logs to an aggregator) class MultiLogger(Logger):
"""Log to Dagster and to the default logger"""
python_logger: Logger
dagster_logger: Logger
def __init__(
self,
name,
python_logger: Logger,
dagster_logger: Logger,
level=settings.LOG.LEVEL,
):
super().__init__(name, level=level)
self.python_logger = python_logger
self.dagster_logger = dagster_logger
def _log(self, level, msg, args, **kwargs):
self.python_logger.log(level, msg, *args, **kwargs)
self.dagster_logger.log(level, msg, *args, **kwargs)
def get_dagster_and_python_logger(name: str) -> Logger:
return MultiLogger(
name,
python_logger=logging.getLogger(name),
dagster_logger=get_dagster_logger(name),
) |
Beta Was this translation helpful? Give feedback.
-
Any thoughts on using eliot for logging? |
Beta Was this translation helpful? Give feedback.
-
Overview
Logging is central to Dagster's core infrastructure, providing observability to computations defined using the framework as well as to Dagster components that aid in executing the computations.
Here are some examples where logging is used in the system:
stdout
andstderr
logs using Dagster's compute log storage.uvicorn
server powering the Dagster UI and GraphQL interface),gRPC
) that host the user's Dagster definitions and interface with the Dagster UI and the daemon.Problems
Existing User Issues
Here is a sample of user-reported issues regarding our logging configuration, mostly dealing with (3) providing observability in Dagster infrastructure components. Currently, configuring logging in these components is not well supported.
dagster api execute_run
#4992Proposed Solution
Standardization of Dagster's logging interface must occur. Here are a few high-level changes that need to happen:
uvicorn
's--log-config
setting, which takes in a user-defined object.Beta Was this translation helpful? Give feedback.
All reactions