Skip to content

Commit e9323e7

Browse files
author
Eric Wong
committed
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 <[email protected]>
1 parent f46e130 commit e9323e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-instaweb.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,15 @@ EOF
216216
cat >"$fqgitdir/gitweb/$httpd.rb" <<EOF
217217
#!/usr/bin/env ruby
218218
require 'webrick'
219+
require 'logger'
219220
options = {
220221
:Port => $port,
221222
: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+
],
222228
:DirectoryIndex => ["gitweb.cgi"],
223229
:CGIInterpreter => "$wrapper",
224230
:StartCallback => lambda do

0 commit comments

Comments
 (0)