X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/15d02990717b0535a2b37633d65b5559c796fd02..6e7da07c709187c0fb72f8bed7963343ddd95160:/cookbooks/web/templates/default/api-statistics.erb diff --git a/cookbooks/web/templates/default/api-statistics.erb b/cookbooks/web/templates/default/api-statistics.erb index 297a2ef51..ce3af0b34 100644 --- a/cookbooks/web/templates/default/api-statistics.erb +++ b/cookbooks/web/templates/default/api-statistics.erb @@ -34,7 +34,7 @@ statistics = { File::Tail::Logfile.tail("/var/log/apache2/access.log") do |line| begin - hash = parser.parse(line) + hash = parser.parse!(line) uri = categorise_uri(hash["%r"]) status = hash["%>s"] @@ -51,8 +51,8 @@ File::Tail::Logfile.tail("/var/log/apache2/access.log") do |line| statistics[:seconds][[uri, status]] += seconds statistics[:ssl][[protocol, cipher]] += 1 unless protocol == "-" statistics[:auth][auth] += 1 unless auth == "-" - rescue ApacheLogRegex::ParseError - # nil + rescue ApacheLogRegex::ParseError => ex + STDERR.puts ex.to_s end if Time.now - last_write > 10