9
I have a Logger instance:
require 'logger'
logger = Logger.new( 'foo.log', 'weekly' )
I want to redirect runtime errors (stderr output) into the log as well. I found this forum thread which has the advice:
new_fd = logger.get_logger_file_descriptor
$stderr.reopen new_fd
However, Logger does not have an instance method get_logger_file_descriptor, nor can I find any exposed methods around gaining access to the log device or file.
How can I cause all $stderr output to go into the log?