From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 Feb 2008 19:44:27 +0000 Subject: Converted logging to use log4net. Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 208 +++++++++++---------- .../Communications/OGS1/OGS1InterSimComms.cs | 8 +- .../Communications/OGS1/OGS1InventoryService.cs | 24 +-- .../Region/Communications/OGS1/OGS1UserServices.cs | 60 +++--- 4 files changed, 153 insertions(+), 147 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 1576bf3..f04574a 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -47,6 +47,8 @@ namespace OpenSim.Region.Communications.OGS1 { public class OGS1GridServices : IGridServices, IInterRegionCommunications { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private LocalBackEndServices m_localBackend = new LocalBackEndServices(); private Dictionary m_remoteRegionInfoCache = new Dictionary(); private List m_knownRegions = new List(); @@ -138,7 +140,7 @@ namespace OpenSim.Region.Communications.OGS1 GridResp = GridReq.Send(serversInfo.GridURL, 10000); } catch (Exception ex) { - MainLog.Instance.Error("Unable to connect to grid. Grid server not running?"); + m_log.Error("Unable to connect to grid. Grid server not running?"); throw(ex); } Hashtable GridRespData = (Hashtable)GridResp.Value; @@ -148,7 +150,7 @@ namespace OpenSim.Region.Communications.OGS1 if (GridRespData.ContainsKey("error")) { string errorstring = (string) GridRespData["error"]; - MainLog.Instance.Error("Unable to connect to grid: " + errorstring); + m_log.Error("Unable to connect to grid: " + errorstring); return null; } else @@ -330,9 +332,9 @@ namespace OpenSim.Region.Communications.OGS1 } catch (WebException) { - MainLog.Instance.Error("GRID", - "Region lookup failed for: " + regionHandle.ToString() + - " - Is the GridServer down?"); + m_log.Error("[GRID]: " + + "Region lookup failed for: " + regionHandle.ToString() + + " - Is the GridServer down?"); return null; } } @@ -421,7 +423,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (Exception e) { - MainLog.Instance.Error("MapBlockQuery XMLRPC failure: " + e.ToString()); + m_log.Error("MapBlockQuery XMLRPC failure: " + e.ToString()); return new Hashtable(); } } @@ -482,7 +484,7 @@ namespace OpenSim.Region.Communications.OGS1 m_localBackend.TriggerExpectUser(regionHandle, agentData); - MainLog.Instance.Verbose("GRID", "Welcoming new user..."); + m_log.Info("[GRID]: Welcoming new user..."); return new XmlRpcResponse(); } @@ -555,7 +557,7 @@ namespace OpenSim.Region.Communications.OGS1 Console.WriteLine("remoting object not found"); } remObject = null; - //MainLog.Instance.Verbose("INTER", + //m_log.Info("[INTER]: " + //gdebugRegionName + //": OGS1 tried to Update Child Agent data on outside region and got " + //retValue.ToString()); @@ -569,45 +571,45 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (SocketException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + " " + + m_log.Warn("Socket Error: Unable to connect to adjacent region: " + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (InvalidCredentialException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (AuthenticationException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + + m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (Exception e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } } else { - //MainLog.Instance.Verbose("INTERREGION", "Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString()); + //m_log.Info("[INTERREGION]: Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString()); return false; } } @@ -650,10 +652,10 @@ namespace OpenSim.Region.Communications.OGS1 Console.WriteLine("remoting object not found"); } remObject = null; - MainLog.Instance.Verbose("INTER", - gdebugRegionName + ": OGS1 tried to InformRegionOfChildAgent for " + - agentData.firstname + " " + agentData.lastname + " and got " + - retValue.ToString()); + m_log.Info("[INTER]: " + + gdebugRegionName + ": OGS1 tried to InformRegionOfChildAgent for " + + agentData.firstname + " " + agentData.lastname + " and got " + + retValue.ToString()); return retValue; @@ -664,41 +666,41 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (SocketException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + + m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (InvalidCredentialException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (AuthenticationException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + + m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (Exception e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + + m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } } @@ -748,7 +750,7 @@ namespace OpenSim.Region.Communications.OGS1 Console.WriteLine("remoting object not found"); } remObject = null; - MainLog.Instance.Verbose("INTER", gdebugRegionName + ": OGS1 tried to inform region I'm up"); + m_log.Info("[INTER]: " + gdebugRegionName + ": OGS1 tried to inform region I'm up"); return retValue; } @@ -765,49 +767,49 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException e) { - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + - " - Is this neighbor up?"); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Remoting Error: Unable to connect to adjacent region using tcp://" + + regInfo.RemotingAddress + + ":" + regInfo.RemotingPort + + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + + " - Is this neighbor up?"); + m_log.Debug(e.ToString()); return false; } catch (SocketException e) { - MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + - " - Is this neighbor up?"); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + + regInfo.RemotingAddress + + ":" + regInfo.RemotingPort + + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + + " - Is this neighbor up?"); + m_log.Debug(e.ToString()); return false; } catch (InvalidCredentialException e) { - MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + + regInfo.RemotingAddress + + ":" + regInfo.RemotingPort + + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (AuthenticationException e) { - MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + + regInfo.RemotingAddress + + ":" + regInfo.RemotingPort + + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (Exception e) { // This line errors with a Null Reference Exception.. Why? @.@ - //MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + + //m_log.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + // ":" + regInfo.RemotingPort + //"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one"); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } } @@ -860,41 +862,41 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (SocketException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + - regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (InvalidCredentialException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (AuthenticationException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + - regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch (Exception e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } } @@ -947,9 +949,9 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch @@ -1000,9 +1002,9 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + m_log.Debug(e.ToString()); return false; } catch @@ -1052,61 +1054,61 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName + + m_log.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - //MainLog.Instance.Debug(e.ToString()); + //m_log.Debug(e.ToString()); return false; } catch (SocketException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + + m_log.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - Is this neighbor up?"); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (InvalidCredentialException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (AuthenticationException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + + m_log.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (WebException e) { NoteDeadRegion(regionHandle); - MainLog.Instance.Warn("WebException exception: Unable to connect to adjacent region using tcp://" + + m_log.Warn("WebException exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } catch (Exception e) { NoteDeadRegion(regionHandle); // This line errors with a Null Reference Exception.. Why? @.@ - //MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + + //m_log.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + // ":" + regInfo.RemotingPort + //"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one"); - MainLog.Instance.Debug(e.ToString()); + m_log.Debug(e.ToString()); return false; } } @@ -1133,7 +1135,7 @@ namespace OpenSim.Region.Communications.OGS1 /// public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) { - //MainLog.Instance.Verbose("INTER", gdebugRegionName + ": Incoming OGS1 Agent " + agentData.firstname + " " + agentData.lastname); + //m_log.Info("[INTER]: " + gdebugRegionName + ": Incoming OGS1 Agent " + agentData.firstname + " " + agentData.lastname); try { @@ -1141,16 +1143,16 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException) { - //MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + //m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); return false; } } public bool TriggerRegionUp(SearializableRegionInfo regionData, ulong regionhandle) { - MainLog.Instance.Verbose("INTER", - gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX + - "," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries"); + m_log.Info("[INTER]: " + + gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX + + "," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries"); try { @@ -1169,14 +1171,14 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { - MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); return false; } } public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) { - //MainLog.Instance.Verbose("INTER", "Incoming OGS1 Child Agent Data Update"); + //m_log.Info("[INTER]: Incoming OGS1 Child Agent Data Update"); try { @@ -1184,7 +1186,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException e) { - MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); return false; } } @@ -1206,7 +1208,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException e) { - MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); return false; } } @@ -1226,7 +1228,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException e) { - MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); return false; } } @@ -1239,7 +1241,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException e) { - MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); return false; } } @@ -1252,7 +1254,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (RemotingException) { - MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to neighbour to tell it to close a child connection"); + m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to neighbour to tell it to close a child connection"); return false; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index b39e0b7..217bb81 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs @@ -141,6 +141,8 @@ namespace OpenSim.Region.Communications.OGS1 public class OGS1InterRegionRemoting : MarshalByRefObject { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public OGS1InterRegionRemoting() { } @@ -230,18 +232,18 @@ namespace OpenSim.Region.Communications.OGS1 return false; } } + public bool TellRegionToCloseChildConnection(ulong regionHandle, Guid agentID) { try { return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID)); - } catch (RemotingException) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to remote region: " + regionHandle.ToString()); + m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to remote region: " + regionHandle.ToString()); return false; } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 1780707..656dd70 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -38,6 +38,8 @@ namespace OpenSim.Region.Communications.OGS1 { public class OGS1InventoryService : IInventoryServices { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private string _inventoryServerUrl; private Dictionary m_RequestingInventory = new Dictionary(); @@ -71,9 +73,9 @@ namespace OpenSim.Region.Communications.OGS1 { try { - MainLog.Instance.Verbose( - "INVENTORY", "Requesting inventory from {0}/GetInventory/ for user {1}", - _inventoryServerUrl, userID); + m_log.Info( + String.Format("[INVENTORY]: Requesting inventory from {0}/GetInventory/ for user {1}", + _inventoryServerUrl, userID)); RestObjectPosterResponse requester = new RestObjectPosterResponse(); @@ -83,7 +85,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (Exception e) { - MainLog.Instance.Error("INVENTORY", e.ToString()); + m_log.Error("[INVENTORY]: " + e.ToString()); } } @@ -96,9 +98,9 @@ namespace OpenSim.Region.Communications.OGS1 LLUUID userID = response.UserID; if (m_RequestingInventory.ContainsKey(userID)) { - MainLog.Instance.Verbose("INVENTORY", + m_log.Info(String.Format("[INVENTORY]: " + "Received inventory response for user {0} containing {1} folders and {2} items", - userID, response.Folders.Count, response.AllItems.Count); + userID, response.Folders.Count, response.AllItems.Count)); InventoryFolderImpl rootFolder = null; InventoryRequest request = m_RequestingInventory[userID]; @@ -132,10 +134,10 @@ namespace OpenSim.Region.Communications.OGS1 } else { - MainLog.Instance.Warn( - "INVENTORY", - "Received inventory response for {0} for which we do not have a record of requesting!", - userID); + m_log.Warn( + String.Format("[INVENTORY]: " + + "Received inventory response for {0} for which we do not have a record of requesting!", + userID)); } } @@ -198,4 +200,4 @@ namespace OpenSim.Region.Communications.OGS1 } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 70b7e89..9a22d14 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -40,6 +40,8 @@ namespace OpenSim.Region.Communications.OGS1 { public class OGS1UserServices : IUserService { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private CommunicationsOGS1 m_parent; public OGS1UserServices(CommunicationsOGS1 parent) @@ -51,10 +53,10 @@ namespace OpenSim.Region.Communications.OGS1 { if (data.Contains("error_type")) { - MainLog.Instance.Warn("GRID", - "Error sent by user server when trying to get user profile: (" + - data["error_type"] + - "): " + data["error_desc"]); + m_log.Warn("[GRID]: " + + "Error sent by user server when trying to get user profile: (" + + data["error_type"] + + "): " + data["error_desc"]); return null; } @@ -104,7 +106,7 @@ namespace OpenSim.Region.Communications.OGS1 } else { - MainLog.Instance.Warn("INTERGRID", "Got invalid queryID from userServer"); + m_log.Warn("[INTERGRID]: Got invalid queryID from userServer"); } return pickerlist; } @@ -158,7 +160,7 @@ namespace OpenSim.Region.Communications.OGS1 } catch (System.Net.WebException) { - MainLog.Instance.Warn("LOGOFF", "Unable to notify grid server of user logoff"); + m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff"); } @@ -186,8 +188,8 @@ namespace OpenSim.Region.Communications.OGS1 } catch (WebException e) { - MainLog.Instance.Warn("Error when trying to fetch Avatar Picker Response: " + - e.Message); + m_log.Warn("Error when trying to fetch Avatar Picker Response: " + + e.Message); // Return Empty picker list (no results) } return pickerlist; @@ -209,8 +211,8 @@ namespace OpenSim.Region.Communications.OGS1 } catch (WebException e) { - MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " + - e.Message); + m_log.Warn("Error when trying to fetch profile data by name from remote user server: " + + e.Message); } return null; } @@ -299,24 +301,24 @@ namespace OpenSim.Region.Communications.OGS1 } else { - MainLog.Instance.Warn("GRID", "Unable to add new friend, User Server Reported an issue"); + m_log.Warn("[GRID]: Unable to add new friend, User Server Reported an issue"); } } else { - MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!"); + m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!"); } } else { - MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!"); + m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!"); } } catch (WebException e) { - MainLog.Instance.Warn("GRID","Error when trying to AddNewUserFriend: " + - e.Message); + m_log.Warn("[GRID]: Error when trying to AddNewUserFriend: " + + e.Message); } @@ -352,24 +354,24 @@ namespace OpenSim.Region.Communications.OGS1 } else { - MainLog.Instance.Warn("GRID", "Unable to remove friend, User Server Reported an issue"); + m_log.Warn("[GRID]: Unable to remove friend, User Server Reported an issue"); } } else { - MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!"); + m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!"); } } else { - MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!"); + m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!"); } } catch (WebException e) { - MainLog.Instance.Warn("GRID", "Error when trying to RemoveUserFriend: " + - e.Message); + m_log.Warn("[GRID]: Error when trying to RemoveUserFriend: " + + e.Message); } } @@ -404,25 +406,24 @@ namespace OpenSim.Region.Communications.OGS1 } else { - MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, User Server Reported an issue"); + m_log.Warn("[GRID]: Unable to update_user_friend_perms, User Server Reported an issue"); } } else { - MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!"); + m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!"); } } else { - MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!"); + m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!"); } } catch (WebException e) { - MainLog.Instance.Warn("GRID", "Error when trying to update_user_friend_perms: " + - e.Message); - + m_log.Warn("[GRID]: Error when trying to update_user_friend_perms: " + + e.Message); } } /// @@ -452,14 +453,13 @@ namespace OpenSim.Region.Communications.OGS1 } catch (WebException e) { - MainLog.Instance.Warn("Error when trying to fetch Avatar's friends list: " + - e.Message); + m_log.Warn("Error when trying to fetch Avatar's friends list: " + + e.Message); // Return Empty list (no friends) } return buddylist; - } #endregion } -} \ No newline at end of file +} -- cgit v1.1