def self.httpd_actual_error_log(options = nil)
if config_file = httpd_default_config_file(options)
begin
contents = File.open(config_file, "rb") { |f| f.read }
rescue Errno::ENOENT
log "#{config_file} does not exist"
return nil
rescue Errno::EACCES
log "Unable to open #{config_file} for reading"
return nil
end
contents.gsub!(/^[ \t]*#.*/, '')
if contents =~ /^[ \t]*ErrorLog[ \t]+(.+)[ \t]*$/i
filename = unescape_apache_config_value($1, options)
if filename && filename !~ /\A\//
if root = httpd_default_root(options)
return "#{root}/#{filename}"
else
return nil
end
else
return filename
end
elsif contents =~ /ErrorLog/i
log "Unable to parse ErrorLog directive in Apache configuration file"
return nil
else
log "No ErrorLog directive in Apache configuration file"
return httpd_default_error_log(options)
end
else
return nil
end
end