instaweb: add access+error logging for WEBrick
This allows WEBrick to support all the logging functionality in a manner consistent with the other web servers. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Aug 5, 2010 at 08:46 UTC
e9323e7f09d171739e8dbc9d60d77281caa06177
1 file changed
+6
git-instaweb.sh
+6
@@ -216,9 +216,15 @@ EOF
216
cat >"$fqgitdir/gitweb/$httpd.rb" <<EOF
217
#!/usr/bin/env ruby
218
require 'webrick'
219
+require 'logger'
220
options = {
221
:Port => $port,
222
:DocumentRoot => "$root",
223
+ :Logger => Logger.new('$fqgitdir/gitweb/error.log'),
224
+ :AccessLog => [
225
+ [ Logger.new('$fqgitdir/gitweb/access.log'),
226
+ WEBrick::AccessLog::COMBINED_LOG_FORMAT ]
227
+ ],
228
:DirectoryIndex => ["gitweb.cgi"],
229
:CGIInterpreter => "$wrapper",
230
:StartCallback => lambda do