<p>I am working on creating a daemon in Ruby using the daemons gem. I want to add output from the daemon into a log file. I am wondering what is the easiest way to redirect <code>puts</code> from the console to a log file.</p>

Try
```
```
$stdout = File.new( '/tmp/output', 'w' )
```
```
To restore:
```
```
$stdout = STDOUT
```
```