From: Aki Tuomi Date: Thu, 23 Jan 2014 17:09:31 +0000 (+0200) Subject: Added few missing loggings X-Git-Tag: rec-3.6.0-rc1~228^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2955907794fbfb816201543b5bfb03d3d69d7429;p=pdns Added few missing loggings --- diff --git a/modules/remotebackend/regression-tests/dnsbackend.rb b/modules/remotebackend/regression-tests/dnsbackend.rb index b26e478da..35de50207 100644 --- a/modules/remotebackend/regression-tests/dnsbackend.rb +++ b/modules/remotebackend/regression-tests/dnsbackend.rb @@ -5,7 +5,7 @@ class DNSBackendHandler < WEBrick::HTTPServlet::AbstractServlet def initialize(server, dnsbackend) @dnsbackend = dnsbackend @semaphore = Mutex.new - @f = File.open("/tmp/remotebackend.txt","a") + @f = File.open("/tmp/remotebackend.txt.#{$$}","a") @f.sync end @@ -103,21 +103,21 @@ class DNSBackendHandler < WEBrick::HTTPServlet::AbstractServlet args = parse_arrays args - @f.puts method - @f.puts args + @f.puts "#{Time.now.to_f} [http]: #{({:method=>method,:parameters=>args}).to_json}" @semaphore.synchronize do if @dnsbackend.respond_to?(method.to_sym) - result, log = @dnsbackend.send(method.to_sym, args) - body = {:result => result, :log => log} - res.status = 200 - res["Content-Type"] = "application/javascript; charset=utf-8" - res.body = body.to_json - else - res.status = 404 - res["Content-Type"] = "application/javascript; charset=utf-8" - res.body = ({:result => false, :log => ["Method not found"]}).to_json - end + result, log = @dnsbackend.send(method.to_sym, args) + body = {:result => result, :log => log} + res.status = 200 + res["Content-Type"] = "application/javascript; charset=utf-8" + res.body = body.to_json + else + res.status = 404 + res["Content-Type"] = "application/javascript; charset=utf-8" + res.body = ({:result => false, :log => ["Method not found"]}).to_json + end + @f.puts "#{Time.now.to_f} [http]: #{res.body}" end end diff --git a/modules/remotebackend/regression-tests/unix-backend.rb b/modules/remotebackend/regression-tests/unix-backend.rb index a1f79daed..c3037146a 100755 --- a/modules/remotebackend/regression-tests/unix-backend.rb +++ b/modules/remotebackend/regression-tests/unix-backend.rb @@ -7,7 +7,7 @@ require "backend" h = Handler.new("#{File.dirname(__FILE__)}/remote.sqlite3") -f = File.open "/tmp/remotebackend.txt","a" +f = File.open "/tmp/remotebackend.txt.#{$$}","a" f.sync = true STDOUT.sync = true