summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias H <apoc@sixserv.org>2014-02-24 07:33:44 +0100
committerMatthias H <apoc@sixserv.org>2014-02-24 07:33:44 +0100
commit0041296443e8ae0779aec721b902bd83d799e0a1 (patch)
tree7298a2f4228057d06e35b26ae462fa470c87abae /lib
parente8e8a2c78c95c24f99c2a18aeeaff8ac243a41ef (diff)
[webservice] log requests to seperate file in profile
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/core/webservice.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rbot/core/webservice.rb b/lib/rbot/core/webservice.rb
index 7183a245..0eb65522 100644
--- a/lib/rbot/core/webservice.rb
+++ b/lib/rbot/core/webservice.rb
@@ -134,6 +134,12 @@ class WebServiceModule < CoreBotModule
# serial number which makes this feature pretty much useless.
end
end
+ # Logging to file in ~/.rbot
+ logfile = File.open(@bot.path('webservice.log'), 'a+')
+ opts.merge!({
+ :Logger => WEBrick::Log.new(logfile),
+ :AccessLog => [[logfile, WEBrick::AccessLog::COMBINED_LOG_FORMAT]]
+ })
@server = WEBrick::HTTPServer.new(opts)
debug 'webservice started: ' + opts.inspect
@server.mount('/dispatch', DispatchServlet, @bot)