You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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: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.
The text was updated successfully, but these errors were encountered: