Skip to content

Conversation

@jiteshgolecha
Copy link

Summary

This update modifies the Envoy execution flow to pass captured output logs to both @after and @error hooks.

Changes

  • Captures task output (stdout and stderr) per host during task execution.
  • Stores logs in $this->taskOutputLogs inside RunCommand.
  • Modifies call_user_func_array for @after and @error to pass $task and $logs.
  • Updates Blade compiler (compileAfter and compileError) to accept $logs as second parameter in closure.
  • Enables direct usage of $logs in @after / @error blocks without extra unpacking.

Benefits

  • Hooks now have access to execution logs per host.
  • Simplifies centralized logging and debugging.
  • No additional global classes or static references needed.

Example Usage

@after
    foreach ($logs as $host => $output) {
        file_put_contents("/tmp/deploy_{$host}.log", $output);
    }
@endafter

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants