Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drush proxy log object #4422

Open
jasonpartyka opened this issue May 26, 2020 · 1 comment
Open

Drush proxy log object #4422

jasonpartyka opened this issue May 26, 2020 · 1 comment

Comments

@jasonpartyka
Copy link

Is your feature request related to a problem? Please describe.
When running Drush commands via cron (or any other scheduler), it would be very useful to be able to redirect the logging output.

Describe the solution you'd like
To be able to redirect a the logs for an arbitrary command to the specified location. For example, I may want to collect any output related to running drush core:cron to a specific location to log all cron data in a specific location.

Describe alternatives you've considered
Unix-level redirects can be used to redirect all output to a specific location. However, this only works for users who have direct shell access, or there is some other mechanism to forward on the logs.

Additional context
I had a conversation with greg.1.anderson on the d.o slack regarding this, and he suggested that:

I think the way to do this would be to make a Drush proxy log object.
That would just be a simple PSR-3 interface that called through to a Drush\Log\Logger instance.

The Drupal module monolog which integrates with the same-named library is a possible implementation of this interface. This would then allow the client code to redirect the output to wherever desired -- a specific file, api endpoint, etc.

@greg-1-anderson
Copy link
Member

Drush maintainers are unlikely to work on this, but PRs are welcome.

Adding monolog to Drush core is probably not the right thing to do, but we could accept a PR that added the ability for a Drush extension to plug in a custom logger.

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

No branches or pull requests

2 participants