[csw-devel] SF.net SVN: opencsw:[491] catalog_signatures/bin/http_gpg_daemon

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu Jul 21 05:31:41 CEST 2011


Revision: 491
          http://opencsw.svn.sourceforge.net/opencsw/?rev=491&view=rev
Author:   bdwalton
Date:     2011-07-21 03:31:41 +0000 (Thu, 21 Jul 2011)

Log Message:
-----------
allow passing --access-log to enable logging

Signed-off-by: Ben Walton <bwalton at opencsw.org>

Modified Paths:
--------------
    catalog_signatures/bin/http_gpg_daemon

Modified: catalog_signatures/bin/http_gpg_daemon
===================================================================
--- catalog_signatures/bin/http_gpg_daemon	2011-07-21 03:31:21 UTC (rev 490)
+++ catalog_signatures/bin/http_gpg_daemon	2011-07-21 03:31:41 UTC (rev 491)
@@ -15,6 +15,7 @@
 opts.gpg = OpenStruct.new
 opts.gpg.home = ENV['APP_GPG']
 opts.gpg.bin = '/opt/csw/bin/gpg'
+opts.log = nil
 
 class GPGDaemon < WEBrick::HTTPServlet::AbstractServlet
   def initialize(server, mirror_path, catalogpath, gpg)
@@ -69,6 +70,12 @@
   end
   o.on('-h', '--help', 'Display help output.') { puts o; exit 0 }
   o.on('-p', '--port PORT', "Use a port other than #{opts.port}") { |p| opts.port = p.to_i }
+  o.on('-l', '--access-log FILE', "Store access log in FILE") do |l|
+    #webrick_log_file = '/dev/null'  # disable logging
+    webrick_logger = WEBrick::Log.new(l, WEBrick::Log::DEBUG)
+    opts.log = [[ webrick_logger, WEBrick::AccessLog::COMBINED_LOG_FORMAT ]]
+  end
+
 end.parse!
 
 if opts.gpg.home.nil?


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list