From 99e52ceb759210d4d292b73bfb3f31122cfe38a1 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 5 Jun 2017 19:53:32 +0100 Subject: [PATCH] More logging, try to fix the 502 gateway error. --- html/website/head.mustache | 2 +- src/tawashi/response.cpp | 4 ++++ src/tawashi/submit_paste_response.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/html/website/head.mustache b/html/website/head.mustache index 06627c4..cbeefcd 100644 --- a/html/website/head.mustache +++ b/html/website/head.mustache @@ -7,7 +7,7 @@ - + diff --git a/src/tawashi/response.cpp b/src/tawashi/response.cpp index 9fbc648..e1d4210 100644 --- a/src/tawashi/response.cpp +++ b/src/tawashi/response.cpp @@ -265,6 +265,10 @@ namespace tawashi { HttpHeader Response::make_redirect (HttpStatusCodes parCode, const std::string& parLocation) { std::ostringstream oss; oss << base_uri() << '/' << parLocation; + + auto statuslog = spdlog::get("statuslog"); + assert(statuslog); + statuslog->info("Redirecting to page \"{}\"", oss.str()); return HttpHeader(parCode, oss.str()); } diff --git a/src/tawashi/submit_paste_response.cpp b/src/tawashi/submit_paste_response.cpp index 69db5c5..d4d2a89 100644 --- a/src/tawashi/submit_paste_response.cpp +++ b/src/tawashi/submit_paste_response.cpp @@ -132,9 +132,9 @@ namespace tawashi { if (token) { std::ostringstream oss; oss << *token; - statuslog->info("Pastie token=\"{}\" redirect=\"{}\"", *token, oss.str()); if (not lang.empty()) oss << '?' << lang; + statuslog->info("Pastie token=\"{}\" redirect=\"{}\"", *token, oss.str()); return this->make_success_response(oss.str()); }