Loggers¶
-
@
dagster.
logger
(config_schema=None, description=None)[source]¶ Define a logger.
The decorated function should accept an
InitLoggerContext
and return an instance oflogging.Logger
. This function will become thelogger_fn
of an underlyingLoggerDefinition
.- Parameters
config_schema (Optional[ConfigSchema]) – The schema for the config. Configuration data available in init_context.logger_config.
description (Optional[str]) – A human-readable description of the logger.
-
class
dagster.
LoggerDefinition
(logger_fn, config_schema=None, description=None)[source]¶ Core class for defining loggers.
Loggers are pipeline-scoped logging handlers, which will be automatically invoked whenever solids in a pipeline log messages.
- Parameters
logger_fn (Callable[[InitLoggerContext], logging.Logger]) – User-provided function to instantiate the logger. This logger will be automatically invoked whenever the methods on
context.log
are called from within solid compute logic.config_schema (Optional[ConfigSchema]) – The schema for the config. Configuration data available in init_context.logger_config.
description (Optional[str]) – A human-readable description of this logger.
-
class
dagster.
InitLoggerContext
[source]¶ Logger-specific initialization context.
An instance of this class is made available as the first argument to the
logger_fn
decorated by@logger
or set on aLoggerDefinition
.Users should not instantiate this class.
-
logger_config
¶ The configuration data provided by the environment config. The schema for this data is defined by
config_schema
on theLoggerDefinition
- Type
Any
-
pipeline_def
¶ The pipeline definition currently being executed.
- Type
-
logger_def
¶ The logger definition for the logger being constructed.
- Type
-