def self.httpd_actual_error_log(options = nil)
if config_file = httpd_default_config_file(options)
contents = File.read(config_file)
contents.gsub!(/^[ \t]*#.*/, '')
if contents =~ /^ErrorLog (.+)$/
filename = $1.strip.sub(/^"/, '').sub(/"$/, '')
if filename.include?("${")
log "Error log seems to be located in \"#{filename}\", " +
"but value contains environment variables. " +
"Attempting to substitute them..."
end
filename.gsub!(/\$\{(.+?)\}/) do |varname|
if value = httpd_infer_envvar($1, options)
log "Substituted \"#{varname}\" -> \"#{value}\""
value
else
log "Cannot substituted \"#{varname}\""
varname
end
end
if filename.include?("${")
return nil
end
if filename !~ /\A\//
if root = httpd_root(options)
return "#{root}/#{filename}"
else
return nil
end
else
return filename
end
elsif contents =~ /ErrorLog/
return nil
else
return httpd_default_error_log(options)
end
else
return nil
end
end