about summary refs log tree commit homepage
path: root/lib/mongrel/debug.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mongrel/debug.rb')
-rw-r--r--lib/mongrel/debug.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mongrel/debug.rb b/lib/mongrel/debug.rb
index 6178872..e3c6504 100644
--- a/lib/mongrel/debug.rb
+++ b/lib/mongrel/debug.rb
@@ -219,6 +219,19 @@ end
 
 
 module RequestLog
+
+  # Just logs whatever requests it gets to STDERR (which ends up in the mongrel
+  # log when daemonized).
+  class Access < GemPlugin::Plugin "/handlers"
+    include Mongrel::HttpHandlerPlugin
+    
+    def process(request,response)
+      p = request.params
+      STDERR.puts "#{p['REMOTE_ADDR']} - [#{HttpServer.httpdate(Time.now)}] \"#{p['REQUEST_METHOD']} #{p["REQUEST_URI"]} HTTP/1.1\""
+    end
+  end
+  
+
   class Files < GemPlugin::Plugin "/handlers"
     include Mongrel::HttpHandlerPlugin