]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-instaweb.sh
instaweb: add access+error logging for WEBrick
[thirdparty/git.git] / git-instaweb.sh
index e69fb74fef11dbcd25f4dce1beb2e65a97f59e94..e6f6ecda177c66a79b18359f7bf8cad9c4744c8c 100755 (executable)
@@ -216,9 +216,15 @@ EOF
        cat >"$fqgitdir/gitweb/$httpd.rb" <<EOF
 #!/usr/bin/env ruby
 require 'webrick'
+require 'logger'
 options = {
   :Port => $port,
   :DocumentRoot => "$root",
+  :Logger => Logger.new('$fqgitdir/gitweb/error.log'),
+  :AccessLog => [
+    [ Logger.new('$fqgitdir/gitweb/access.log'),
+      WEBrick::AccessLog::COMBINED_LOG_FORMAT ]
+  ],
   :DirectoryIndex => ["gitweb.cgi"],
   :CGIInterpreter => "$wrapper",
   :StartCallback => lambda do