Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

extract hostname to an easily-monkey-patchable method

git-svn-id: http://svn.techno-weenie.net/projects/plugins/exception_logger@2224 567b1171-46fb-0310-a4c9-b4bef9110e78
  • Loading branch information...
commit e9ea268d50395a11e4cdb9fd3ced78458fc7f4b4 1 parent cec0621
technoweenie authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/logged_exception.rb
View
6 lib/logged_exception.rb
@@ -17,6 +17,10 @@ def find_exception_class_names
def find_exception_controllers_and_actions
find(:all, :select => "DISTINCT controller_name, action_name", :order => "controller_name, action_name").collect(&:controller_action)
end
+
+ def host_name
+ `hostname -s`.chomp
+ end
end
def backtrace=(backtrace)
@@ -36,7 +40,7 @@ def request=(request)
env = request.env.keys.sort.inject [] do |env, key|
env << '* ' + ("%*-s: %s" % [max.length, key, request.env[key].to_s.strip])
end
- write_attribute(:environment, (env << "* Process: #{$$}" << "* Server : #{`hostname -s`.chomp}") * "\n")
+ write_attribute(:environment, (env << "* Process: #{$$}" << "* Server : #{self.class.host_name}") * "\n")
write_attribute(:request, [
"* URL: #{request.protocol}#{request.env["HTTP_HOST"]}#{request.request_uri}",

0 comments on commit e9ea268

Please sign in to comment.
Something went wrong with that request. Please try again.