From 15844da3af92fc6e874d6b2df8f5da3b490179ec Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 23 Apr 2012 15:27:04 +0300 Subject: [PATCH] Log the full exception when errors occur in BaseHttpServer --- .../Servers/HttpServer/BaseHttpServer.cs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 6fa36b5d15..d0463c8121 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -356,7 +356,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (Exception e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace); + m_log.Error(String.Format("[BASE HTTP SERVER]: OnRequest() failed: {0} ", e.Message), e); } } @@ -551,11 +551,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}. ", e.Message), e); } return; @@ -658,15 +658,15 @@ namespace OpenSim.Framework.Servers.HttpServer // // An alternative may be to turn off all response write exceptions on the HttpListener, but let's go // with the minimum first - m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux ", e.Message), e); } catch (IOException e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); + m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e); } catch (Exception e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); + m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e); SendHTML500(response); } finally @@ -933,11 +933,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e); } } return; @@ -970,11 +970,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e); } } } @@ -1085,12 +1085,12 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (IOException e) { - m_log.WarnFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD IOException {0} ", e.Message), e); } catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } } } @@ -1342,8 +1342,8 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException f) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat( - "[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f); + m_log.Warn( + String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", f.Message), f); } } catch(Exception) @@ -1638,11 +1638,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e); } } } @@ -1679,7 +1679,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } } } @@ -1715,7 +1715,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e); } } } @@ -1794,7 +1794,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void httpServerException(object source, Exception exception) { - m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); + m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1} ", source.ToString(), exception.Message), exception); /* if (HTTPDRunning)// && NotSocketErrors > 5) {