From e31e7c68c8abfd61fed6dabac5403d8adf42ae87 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 23 Apr 2012 15:27:04 +0300 Subject: Log the full exception when errors occur in BaseHttpServer --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 0fbf90a..7d31a89 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 @@ -925,11 +925,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; @@ -962,11 +962,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); } } } @@ -1077,12 +1077,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); } } } @@ -1334,8 +1334,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) @@ -1630,11 +1630,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); } } } @@ -1671,7 +1671,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); } } } @@ -1707,7 +1707,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); } } } @@ -1786,7 +1786,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) { -- cgit v1.1 From 737e1771635061c1f7104499d282bcc279823f98 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Apr 2012 23:46:46 +0100 Subject: Revert "Log the full exception when errors occur in BaseHttpServer" This reverts commit e31e7c68c8abfd61fed6dabac5403d8adf42ae87. Applied for patch assessment and accidentally committed too early. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 7d31a89..0fbf90a 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.Error(String.Format("[BASE HTTP SERVER]: OnRequest() failed: {0}", e.Message), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace); } } @@ -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.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } 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.Warn(String.Format("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); } catch (IOException e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.Message), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); } catch (Exception e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.Message), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); SendHTML500(response); } finally @@ -925,11 +925,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } } return; @@ -962,11 +962,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } } } @@ -1077,12 +1077,12 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD IOException {0}", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e); } catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e); } } } @@ -1334,8 +1334,8 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException f) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn( - String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f.Message), f); + m_log.WarnFormat( + "[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f); } } catch(Exception) @@ -1630,11 +1630,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } } } @@ -1671,7 +1671,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } } } @@ -1707,7 +1707,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } } } @@ -1786,7 +1786,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void httpServerException(object source, Exception exception) { - m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1}", source.ToString(), exception.Message), exception); + m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); /* if (HTTPDRunning)// && NotSocketErrors > 5) { -- cgit v1.1 From 133f05dc41ce3520c0069407106fef5a83b2e96e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 28 Apr 2012 00:29:08 +0100 Subject: Add text about using double quotes to surround console command arguments containing spaces to "help" text. e.g. show object name "My long object name" --- OpenSim/Framework/Console/CommandConsole.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index c5d6b78..87bdacd 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -79,7 +79,11 @@ namespace OpenSim.Framework.Console public List fn; } - public const string GeneralHelpText = "For more information, type 'help ' where is one of the following categories:"; + public const string GeneralHelpText + = "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n"; + + public const string ItemHelpText + = "For more information, type 'help ' where is one of the following:"; /// /// Commands organized by keyword in a tree @@ -108,7 +112,9 @@ namespace OpenSim.Framework.Console // General help if (helpParts.Count == 0) { + help.Add(""); // Will become a newline. help.Add(GeneralHelpText); + help.Add(ItemHelpText); help.AddRange(CollectModulesHelp(tree)); } else @@ -132,7 +138,7 @@ namespace OpenSim.Framework.Console // Check modules first to see if we just need to display a list of those commands if (TryCollectModuleHelp(originalHelpRequest, help)) { - help.Insert(0, GeneralHelpText); + help.Insert(0, ItemHelpText); return help; } -- cgit v1.1