PHP-ETL - Operations
Transform - Log(log)

The log operation writes messages to the logger, useful for debugging and tracking ETL process progress.

Options

  • message: The message to be logged. You can use the Symfony Expression Language to dynamically generate the message. To use the expression language, prefix the message with @.
  • level: The log level. Must be one of the following: debug, info, notice, warning, error, critical, alert, emergency.
  • context: (Optional) An array of data to be included in the log context. The keys of the array are the names of the context variables, and the values are the keys from the input data.

Example

Here’s an example of how to use the log operation to log a message with the user’s ID and email address:

chain:
  - operation: log
    options:
      level: info
      message: "@'Processing user ' ~ data.id"
      context:
        user_id: id
        email: email