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. --- OpenSim/Grid/MessagingServer/MessageService.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'OpenSim/Grid/MessagingServer/MessageService.cs') diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index 056bfcb..c2669b0 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs @@ -43,7 +43,8 @@ namespace OpenSim.Grid.MessagingServer { public class MessageService { - private LogBase m_log; + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private MessageServerConfig m_cfg; //A hashtable of all current presences this server knows about @@ -58,13 +59,10 @@ namespace OpenSim.Grid.MessagingServer // Hashtable containing work units that need to be processed private Hashtable m_unProcessedWorkUnits = new Hashtable(); - - public MessageService(LogBase log, MessageServerConfig cfg) + public MessageService(MessageServerConfig cfg) { - m_log = log; m_cfg = cfg; } - #region RegionComms Methods @@ -84,7 +82,7 @@ namespace OpenSim.Grid.MessagingServer ArrayList SendParams = new ArrayList(); SendParams.Add(PresenceParams); - MainLog.Instance.Verbose("PRESENCE", "Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); + m_log.Info("[PRESENCE]: Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); // Send XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); @@ -292,7 +290,7 @@ namespace OpenSim.Grid.MessagingServer } catch (WebException e) { - MainLog.Instance.Warn("Error when trying to fetch Avatar's friends list: " + + m_log.Warn("Error when trying to fetch Avatar's friends list: " + e.Message); // Return Empty list (no friends) } @@ -439,7 +437,7 @@ namespace OpenSim.Grid.MessagingServer if (responseData.ContainsKey("error")) { - m_log.Error("GRID","error received from grid server" + responseData["error"]); + m_log.Error("[GRID]: error received from grid server" + responseData["error"]); return null; } @@ -465,7 +463,7 @@ namespace OpenSim.Grid.MessagingServer } catch (WebException) { - MainLog.Instance.Error("GRID", + m_log.Error("[GRID]: " + "Region lookup failed for: " + regionHandle.ToString() + " - Is the GridServer down?"); return null; -- cgit v1.1