1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-17 10:42:19 -05:00

Added logger instance to database class, more informative fail messages.

Logs all HTTP requests
This commit is contained in:
RaidMax
2017-11-14 15:36:55 -06:00
parent 3ccd0013b4
commit 89381bcc7d
10 changed files with 79 additions and 54 deletions

View File

@ -15,7 +15,7 @@ namespace IW4MAdmin
{
// it looks like there's a library error in
// Kayak.Http.HttpServerTransactionDelegate.OnError
if ((uint)e.HResult == 0x80004003)
if ((uint)e.HResult == 0x80004003 || (uint)e.InnerException?.HResult == 0x80004003)
return;
ApplicationManager.GetInstance().Logger.WriteWarning("Web service has encountered an error - " + e.Message);
@ -39,6 +39,11 @@ namespace IW4MAdmin
{
public void OnRequest(HttpRequestHead request, IDataProducer requestBody, IHttpResponseDelegate response, string IP)
{
var logger = ApplicationManager.GetInstance().GetLogger();
logger.WriteInfo($"HTTP request {request.Path}");
logger.WriteInfo($"QueryString: {request.QueryString}");
logger.WriteInfo($"IP: {IP}");
NameValueCollection querySet = new NameValueCollection();
if (request.QueryString != null)