From ec6017c92b26976b727fa364e57759f6f44174ef Mon Sep 17 00:00:00 2001 From: justincc Date: Wed, 16 Dec 2009 16:47:28 +0000 Subject: [PATCH] Turn on HttpServer_OpenSim.dll logging temporarily --- .../Servers/HttpServer/BaseHttpServer.cs | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 3d6051d895..8eeb0679ac 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -40,7 +40,8 @@ using HttpServer; using log4net; using Nwc.XmlRpc; using OpenMetaverse.StructuredData; -using CoolHTTPListener = HttpServer.HttpListener; +using CoolHTTPListener = HttpServer.HttpListener; +using CoolHttpServer = HttpServer; using HttpListener=System.Net.HttpListener; namespace OpenSim.Framework.Servers.HttpServer @@ -729,12 +730,12 @@ namespace OpenSim.Framework.Servers.HttpServer xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint); } catch(Exception e) - { - string errorMessage - = String.Format( - "Requested method [{0}] from {1} threw exception: {2} {3}", - methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace); - + { + string errorMessage + = String.Format( + "Requested method [{0}] from {1} threw exception: {2} {3}", + methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace); + m_log.ErrorFormat("[BASE HTTP SERVER]: {0}", errorMessage); // if the registered XmlRpc method threw an exception, we pass a fault-code along @@ -1819,34 +1820,32 @@ namespace OpenSim.Framework.Servers.HttpServer /// There is also a UseTraceLogs line in this file that can be uncommented for more detailed log information public class HttpServerLogWriter : ILogWriter { - //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public void Write(object source, LogPrio priority, string message) { - /* switch (priority) - { - case HttpServer.LogPrio.Debug: + { + case CoolHttpServer.LogPrio.Debug: m_log.DebugFormat("[{0}]: {1}", source.ToString(), message); - break; - case HttpServer.LogPrio.Error: + break; + case CoolHttpServer.LogPrio.Error: m_log.ErrorFormat("[{0}]: {1}", source.ToString(), message); - break; - case HttpServer.LogPrio.Info: + break; + case CoolHttpServer.LogPrio.Info: m_log.InfoFormat("[{0}]: {1}", source.ToString(), message); - break; - case HttpServer.LogPrio.Warning: + break; + case CoolHttpServer.LogPrio.Warning: m_log.WarnFormat("[{0}]: {1}", source.ToString(), message); - break; - case HttpServer.LogPrio.Fatal: + break; + case CoolHttpServer.LogPrio.Fatal: m_log.ErrorFormat("[{0}]: FATAL! - {1}", source.ToString(), message); break; default: break; } - */ return; } } -} +} \ No newline at end of file