Book Image

Drush for Developers - Second Edition

By : Juan Pablo Novillo Requena, Juan P Novillo Requena
Book Image

Drush for Developers - Second Edition

By: Juan Pablo Novillo Requena, Juan P Novillo Requena

Overview of this book

Table of Contents (13 chapters)
Drush for Developers Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Keeping Database Configuration and Code Together
Index

Redirecting Drush output into a file


Some Drush commands will take time to complete and generate a long output. In such cases, it is useful to record the output into a logfile. After running a migration script, for example, you would like to thoroughly read the log, so you can check whether each migration step is completed as expected. As for cron runs, you would like to keep a log of them so that when you receive an alert, you can look at the log of the last cron runs to debug it.

Now, before you decide to redirect the output of a command into a log, you should be aware of the nature of input and output streams (http://en.wikipedia.org/wiki/Standard_streams). Each process (Drush executing a command, for example), will have three streams:

  • STDIN: This is the standard input stream used to receive data (when you request the user to choose a topic out of a list using the drush topic command).

  • STDOUT: This is the standard output stream used to print back results. If you are running a command in...