diff options
Diffstat (limited to 'OpenSim/Grid')
28 files changed, 295 insertions, 312 deletions
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index a95ea71..35e6495 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs | |||
@@ -43,6 +43,8 @@ namespace OpenSim.Grid.AssetServer | |||
43 | /// </summary> | 43 | /// </summary> |
44 | public class OpenAsset_Main : BaseOpenSimServer, conscmd_callback | 44 | public class OpenAsset_Main : BaseOpenSimServer, conscmd_callback |
45 | { | 45 | { |
46 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
46 | public AssetConfig m_config; | 48 | public AssetConfig m_config; |
47 | 49 | ||
48 | public static OpenAsset_Main assetserver; | 50 | public static OpenAsset_Main assetserver; |
@@ -55,7 +57,9 @@ namespace OpenSim.Grid.AssetServer | |||
55 | [STAThread] | 57 | [STAThread] |
56 | public static void Main(string[] args) | 58 | public static void Main(string[] args) |
57 | { | 59 | { |
58 | Console.WriteLine("Starting...\n"); | 60 | log4net.Config.XmlConfigurator.Configure(); |
61 | |||
62 | m_log.Info("Starting...\n"); | ||
59 | 63 | ||
60 | assetserver = new OpenAsset_Main(); | 64 | assetserver = new OpenAsset_Main(); |
61 | assetserver.Startup(); | 65 | assetserver.Startup(); |
@@ -65,42 +69,32 @@ namespace OpenSim.Grid.AssetServer | |||
65 | 69 | ||
66 | private void Work() | 70 | private void Work() |
67 | { | 71 | { |
68 | m_log.Notice("Enter help for a list of commands"); | 72 | m_console.Notice("Enter help for a list of commands"); |
69 | 73 | ||
70 | while (true) | 74 | while (true) |
71 | { | 75 | { |
72 | m_log.MainLogPrompt(); | 76 | m_console.Prompt(); |
73 | } | 77 | } |
74 | } | 78 | } |
75 | 79 | ||
76 | private OpenAsset_Main() | 80 | private OpenAsset_Main() |
77 | { | 81 | { |
78 | if (!Directory.Exists(Util.logDir())) | 82 | m_console = new ConsoleBase("OpenAsset", this); |
79 | { | ||
80 | Directory.CreateDirectory(Util.logDir()); | ||
81 | } | ||
82 | |||
83 | m_log = | ||
84 | new LogBase( | ||
85 | (Path.Combine(Util.logDir(), "opengrid-AssetServer-console.log")), | ||
86 | "OpenAsset", | ||
87 | this, | ||
88 | true); | ||
89 | 83 | ||
90 | MainLog.Instance = m_log; | 84 | MainConsole.Instance = m_console; |
91 | } | 85 | } |
92 | 86 | ||
93 | public void Startup() | 87 | public void Startup() |
94 | { | 88 | { |
95 | m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); | 89 | m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); |
96 | 90 | ||
97 | m_log.Verbose("ASSET", "Setting up asset DB"); | 91 | m_log.Info("[ASSET]: Setting up asset DB"); |
98 | setupDB(m_config); | 92 | setupDB(m_config); |
99 | 93 | ||
100 | m_log.Verbose("ASSET", "Loading default asset set.."); | 94 | m_log.Info("[ASSET]: Loading default asset set.."); |
101 | LoadDefaultAssets(); | 95 | LoadDefaultAssets(); |
102 | 96 | ||
103 | m_log.Verbose("ASSET", "Starting HTTP process"); | 97 | m_log.Info("[ASSET]: Starting HTTP process"); |
104 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 98 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); |
105 | 99 | ||
106 | StatsManager.StartCollectingAssetStats(); | 100 | StatsManager.StartCollectingAssetStats(); |
@@ -118,7 +112,7 @@ namespace OpenSim.Grid.AssetServer | |||
118 | 112 | ||
119 | public IAssetProvider LoadDatabasePlugin(string FileName) | 113 | public IAssetProvider LoadDatabasePlugin(string FileName) |
120 | { | 114 | { |
121 | MainLog.Instance.Verbose("ASSET SERVER", "LoadDatabasePlugin: Attempting to load " + FileName); | 115 | m_log.Info("[ASSET SERVER]: LoadDatabasePlugin: Attempting to load " + FileName); |
122 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 116 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
123 | IAssetProvider assetPlugin = null; | 117 | IAssetProvider assetPlugin = null; |
124 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 118 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
@@ -134,7 +128,7 @@ namespace OpenSim.Grid.AssetServer | |||
134 | assetPlugin = plug; | 128 | assetPlugin = plug; |
135 | assetPlugin.Initialise(); | 129 | assetPlugin.Initialise(); |
136 | 130 | ||
137 | MainLog.Instance.Verbose("ASSET SERVER", "Added " + assetPlugin.Name + " " + assetPlugin.Version); | 131 | m_log.Info("[ASSET SERVER]: Added " + assetPlugin.Name + " " + assetPlugin.Version); |
138 | break; | 132 | break; |
139 | } | 133 | } |
140 | 134 | ||
@@ -153,14 +147,14 @@ namespace OpenSim.Grid.AssetServer | |||
153 | m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider); | 147 | m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider); |
154 | if (m_assetProvider == null) | 148 | if (m_assetProvider == null) |
155 | { | 149 | { |
156 | MainLog.Instance.Error("ASSET", "Failed to load a database plugin, server halting"); | 150 | m_log.Error("[ASSET]: Failed to load a database plugin, server halting"); |
157 | Environment.Exit(-1); | 151 | Environment.Exit(-1); |
158 | } | 152 | } |
159 | } | 153 | } |
160 | catch (Exception e) | 154 | catch (Exception e) |
161 | { | 155 | { |
162 | MainLog.Instance.Warn("ASSET", "setupDB() - Exception occured"); | 156 | m_log.Warn("[ASSET]: setupDB() - Exception occured"); |
163 | MainLog.Instance.Warn("ASSET", e.ToString()); | 157 | m_log.Warn("[ASSET]: " + e.ToString()); |
164 | } | 158 | } |
165 | } | 159 | } |
166 | 160 | ||
@@ -181,18 +175,18 @@ namespace OpenSim.Grid.AssetServer | |||
181 | switch (cmd) | 175 | switch (cmd) |
182 | { | 176 | { |
183 | case "help": | 177 | case "help": |
184 | m_log.Notice( | 178 | m_console.Notice( |
185 | @"shutdown - shutdown this asset server (USE CAUTION!) | 179 | @"shutdown - shutdown this asset server (USE CAUTION!) |
186 | stats - statistical information for this server"); | 180 | stats - statistical information for this server"); |
187 | 181 | ||
188 | break; | 182 | break; |
189 | 183 | ||
190 | case "stats": | 184 | case "stats": |
191 | m_log.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); | 185 | m_console.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); |
192 | break; | 186 | break; |
193 | 187 | ||
194 | case "shutdown": | 188 | case "shutdown": |
195 | m_log.Close(); | 189 | m_console.Close(); |
196 | Environment.Exit(0); | 190 | Environment.Exit(0); |
197 | break; | 191 | break; |
198 | } | 192 | } |
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs index 5c497b6..cb9e1ae 100644 --- a/OpenSim/Grid/AssetServer/RestService.cs +++ b/OpenSim/Grid/AssetServer/RestService.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Grid.AssetServer | |||
41 | { | 41 | { |
42 | public class GetAssetStreamHandler : BaseStreamHandler | 42 | public class GetAssetStreamHandler : BaseStreamHandler |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | private OpenAsset_Main m_assetManager; | 46 | private OpenAsset_Main m_assetManager; |
45 | private IAssetProvider m_assetProvider; | 47 | private IAssetProvider m_assetProvider; |
46 | 48 | ||
@@ -52,7 +54,7 @@ namespace OpenSim.Grid.AssetServer | |||
52 | public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) | 54 | public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) |
53 | : base("GET", "/assets") | 55 | : base("GET", "/assets") |
54 | { | 56 | { |
55 | MainLog.Instance.Verbose("REST", "In Get Request"); | 57 | m_log.Info("[REST]: In Get Request"); |
56 | m_assetManager = assetManager; | 58 | m_assetManager = assetManager; |
57 | m_assetProvider = assetProvider; | 59 | m_assetProvider = assetProvider; |
58 | } | 60 | } |
@@ -71,8 +73,8 @@ namespace OpenSim.Grid.AssetServer | |||
71 | 73 | ||
72 | if (!LLUUID.TryParse(p[0], out assetID)) | 74 | if (!LLUUID.TryParse(p[0], out assetID)) |
73 | { | 75 | { |
74 | MainLog.Instance.Verbose( | 76 | m_log.Info(String.Format( |
75 | "REST", "GET:/asset ignoring request with malformed UUID {0}", p[0]); | 77 | "[REST]: GET:/asset ignoring request with malformed UUID {0}", p[0])); |
76 | return result; | 78 | return result; |
77 | } | 79 | } |
78 | 80 | ||
@@ -94,10 +96,9 @@ namespace OpenSim.Grid.AssetServer | |||
94 | 96 | ||
95 | result = ms.GetBuffer(); | 97 | result = ms.GetBuffer(); |
96 | 98 | ||
97 | MainLog.Instance.Verbose( | 99 | m_log.Info(String.Format( |
98 | "REST", | 100 | "[REST]: GET:/asset found {0} with name {1}, size {2} bytes", |
99 | "GET:/asset found {0} with name {1}, size {2} bytes", | 101 | assetID, asset.Name, result.Length)); |
100 | assetID, asset.Name, result.Length); | ||
101 | 102 | ||
102 | Array.Resize<byte>(ref result, (int) ms.Length); | 103 | Array.Resize<byte>(ref result, (int) ms.Length); |
103 | } | 104 | } |
@@ -106,13 +107,13 @@ namespace OpenSim.Grid.AssetServer | |||
106 | if (StatsManager.AssetStats != null) | 107 | if (StatsManager.AssetStats != null) |
107 | StatsManager.AssetStats.AddNotFoundRequest(); | 108 | StatsManager.AssetStats.AddNotFoundRequest(); |
108 | 109 | ||
109 | MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID); | 110 | m_log.Info(String.Format("[REST]: GET:/asset failed to find {0}", assetID)); |
110 | } | 111 | } |
111 | } | 112 | } |
112 | } | 113 | } |
113 | catch (Exception e) | 114 | catch (Exception e) |
114 | { | 115 | { |
115 | MainLog.Instance.Error(e.ToString()); | 116 | m_log.Error(e.ToString()); |
116 | } | 117 | } |
117 | return result; | 118 | return result; |
118 | } | 119 | } |
@@ -120,6 +121,8 @@ namespace OpenSim.Grid.AssetServer | |||
120 | 121 | ||
121 | public class PostAssetStreamHandler : BaseStreamHandler | 122 | public class PostAssetStreamHandler : BaseStreamHandler |
122 | { | 123 | { |
124 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
125 | |||
123 | private OpenAsset_Main m_assetManager; | 126 | private OpenAsset_Main m_assetManager; |
124 | private IAssetProvider m_assetProvider; | 127 | private IAssetProvider m_assetProvider; |
125 | 128 | ||
@@ -135,7 +138,7 @@ namespace OpenSim.Grid.AssetServer | |||
135 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); | 138 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); |
136 | AssetBase asset = (AssetBase) xs.Deserialize(request); | 139 | AssetBase asset = (AssetBase) xs.Deserialize(request); |
137 | 140 | ||
138 | MainLog.Instance.Verbose("REST", "StoreAndCommitAsset {0}", asset.FullID); | 141 | m_log.Info(String.Format("[REST]: StoreAndCommitAsset {0}", asset.FullID)); |
139 | m_assetProvider.CreateAsset(asset); | 142 | m_assetProvider.CreateAsset(asset); |
140 | m_assetProvider.CommitAssets(); | 143 | m_assetProvider.CommitAssets(); |
141 | 144 | ||
diff --git a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs index e8225e1..5dde43d 100644 --- a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs +++ b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs | |||
@@ -38,13 +38,15 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
38 | /// </summary> | 38 | /// </summary> |
39 | public class Db40ConfigPlugin: IGridConfig | 39 | public class Db40ConfigPlugin: IGridConfig |
40 | { | 40 | { |
41 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
42 | |||
41 | /// <summary> | 43 | /// <summary> |
42 | /// Loads and returns a configuration objeect | 44 | /// Loads and returns a configuration objeect |
43 | /// </summary> | 45 | /// </summary> |
44 | /// <returns>A grid configuration object</returns> | 46 | /// <returns>A grid configuration object</returns> |
45 | public GridConfig GetConfigObject() | 47 | public GridConfig GetConfigObject() |
46 | { | 48 | { |
47 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Loading Db40Config dll"); | 49 | m_log.Info("[DBGRIDCONFIG]: Loading Db40Config dll"); |
48 | return new DbGridConfig(); | 50 | return new DbGridConfig(); |
49 | } | 51 | } |
50 | } | 52 | } |
@@ -64,24 +66,24 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
64 | /// </summary> | 66 | /// </summary> |
65 | public void LoadDefaults() | 67 | public void LoadDefaults() |
66 | { | 68 | { |
67 | MainLog.Instance.Notice("DbGridConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); | 69 | MainConsole.Instance.Info("DbGridConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); |
68 | 70 | ||
69 | // About the grid options | 71 | // About the grid options |
70 | this.GridOwner = MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); | 72 | this.GridOwner = MainConsole.Instance.CmdPrompt("Grid owner", "OGS development team"); |
71 | 73 | ||
72 | // Asset Options | 74 | // Asset Options |
73 | this.DefaultAssetServer = MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"); | 75 | this.DefaultAssetServer = MainConsole.Instance.CmdPrompt("Default asset server","http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"); |
74 | this.AssetSendKey = MainLog.Instance.CmdPrompt("Key to send to asset server","null"); | 76 | this.AssetSendKey = MainConsole.Instance.CmdPrompt("Key to send to asset server","null"); |
75 | this.AssetRecvKey = MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); | 77 | this.AssetRecvKey = MainConsole.Instance.CmdPrompt("Key to expect from asset server","null"); |
76 | 78 | ||
77 | // User Server Options | 79 | // User Server Options |
78 | this.DefaultUserServer = MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/"); | 80 | this.DefaultUserServer = MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/"); |
79 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server","null"); | 81 | this.UserSendKey = MainConsole.Instance.CmdPrompt("Key to send to user server","null"); |
80 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server","null"); | 82 | this.UserRecvKey = MainConsole.Instance.CmdPrompt("Key to expect from user server","null"); |
81 | 83 | ||
82 | // Region Server Options | 84 | // Region Server Options |
83 | this.SimSendKey = MainLog.Instance.CmdPrompt("Key to send to sims","null"); | 85 | this.SimSendKey = MainConsole.Instance.CmdPrompt("Key to send to sims","null"); |
84 | this.SimRecvKey = MainLog.Instance.CmdPrompt("Key to expect from sims","null"); | 86 | this.SimRecvKey = MainConsole.Instance.CmdPrompt("Key to expect from sims","null"); |
85 | } | 87 | } |
86 | 88 | ||
87 | /// <summary> | 89 | /// <summary> |
@@ -99,7 +101,7 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
99 | // Found? | 101 | // Found? |
100 | if (result.Count==1) | 102 | if (result.Count==1) |
101 | { | 103 | { |
102 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Found a GridConfig object in the local database, loading"); | 104 | m_log.Info("[DBGRIDCONFIG]: Found a GridConfig object in the local database, loading"); |
103 | foreach (DbGridConfig cfg in result) | 105 | foreach (DbGridConfig cfg in result) |
104 | { | 106 | { |
105 | // Import each setting into this class | 107 | // Import each setting into this class |
@@ -121,13 +123,13 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
121 | } | 123 | } |
122 | else | 124 | else |
123 | { | 125 | { |
124 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Could not find object in database, loading precompiled defaults"); | 126 | m_log.Info("[DBGRIDCONFIG]: Could not find object in database, loading precompiled defaults"); |
125 | 127 | ||
126 | // Load default settings into this class | 128 | // Load default settings into this class |
127 | LoadDefaults(); | 129 | LoadDefaults(); |
128 | 130 | ||
129 | // Saves to the database file... | 131 | // Saves to the database file... |
130 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Writing out default settings to local database"); | 132 | m_log.Info("[DBGRIDCONFIG]: Writing out default settings to local database"); |
131 | db.Set(this); | 133 | db.Set(this); |
132 | 134 | ||
133 | // Closes file locks | 135 | // Closes file locks |
@@ -136,27 +138,27 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
136 | } | 138 | } |
137 | catch(Exception e) | 139 | catch(Exception e) |
138 | { | 140 | { |
139 | MainLog.Instance.Warn("DbGridConfig.cs:InitConfig() - Exception occured"); | 141 | m_log.Warn("DbGridConfig.cs:InitConfig() - Exception occured"); |
140 | MainLog.Instance.Warn(e.ToString()); | 142 | m_log.Warn(e.ToString()); |
141 | } | 143 | } |
142 | 144 | ||
143 | // Grid Settings | 145 | // Grid Settings |
144 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid settings loaded:"); | 146 | m_log.Info("[DBGRIDCONFIG]: Grid settings loaded:"); |
145 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid owner: " + this.GridOwner); | 147 | m_log.Info("[DBGRIDCONFIG]: Grid owner: " + this.GridOwner); |
146 | 148 | ||
147 | // Asset Settings | 149 | // Asset Settings |
148 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Default asset server: " + this.DefaultAssetServer); | 150 | m_log.Info("[DBGRIDCONFIG]: Default asset server: " + this.DefaultAssetServer); |
149 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to asset server: " + this.AssetSendKey); | 151 | m_log.Info("[DBGRIDCONFIG]: Key to send to asset server: " + this.AssetSendKey); |
150 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from asset server: " + this.AssetRecvKey); | 152 | m_log.Info("[DBGRIDCONFIG]: Key to expect from asset server: " + this.AssetRecvKey); |
151 | 153 | ||
152 | // User Settings | 154 | // User Settings |
153 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Default user server: " + this.DefaultUserServer); | 155 | m_log.Info("[DBGRIDCONFIG]: Default user server: " + this.DefaultUserServer); |
154 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to user server: " + this.UserSendKey); | 156 | m_log.Info("[DBGRIDCONFIG]: Key to send to user server: " + this.UserSendKey); |
155 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from user server: " + this.UserRecvKey); | 157 | m_log.Info("[DBGRIDCONFIG]: Key to expect from user server: " + this.UserRecvKey); |
156 | 158 | ||
157 | // Region Settings | 159 | // Region Settings |
158 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to sims: " + this.SimSendKey); | 160 | m_log.Info("[DBGRIDCONFIG]: Key to send to sims: " + this.SimSendKey); |
159 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from sims: " + this.SimRecvKey); | 161 | m_log.Info("[DBGRIDCONFIG]: Key to expect from sims: " + this.SimRecvKey); |
160 | } | 162 | } |
161 | 163 | ||
162 | /// <summary> | 164 | /// <summary> |
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index c956a01..49b9aa2 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -38,11 +38,12 @@ using OpenSim.Framework.Console; | |||
38 | using OpenSim.Framework.Data; | 38 | using OpenSim.Framework.Data; |
39 | using OpenSim.Framework.Servers; | 39 | using OpenSim.Framework.Servers; |
40 | 40 | ||
41 | |||
42 | namespace OpenSim.Grid.GridServer | 41 | namespace OpenSim.Grid.GridServer |
43 | { | 42 | { |
44 | internal class GridManager | 43 | internal class GridManager |
45 | { | 44 | { |
45 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
46 | private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); | 47 | private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); |
47 | private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>(); | 48 | private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>(); |
48 | 49 | ||
@@ -57,10 +58,10 @@ namespace OpenSim.Grid.GridServer | |||
57 | /// <param name="FileName">The filename to the grid server plugin DLL</param> | 58 | /// <param name="FileName">The filename to the grid server plugin DLL</param> |
58 | public void AddPlugin(string FileName) | 59 | public void AddPlugin(string FileName) |
59 | { | 60 | { |
60 | MainLog.Instance.Verbose("DATA", "Attempting to load " + FileName); | 61 | m_log.Info("[DATA]: Attempting to load " + FileName); |
61 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 62 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
62 | 63 | ||
63 | MainLog.Instance.Verbose("DATA", "Found " + pluginAssembly.GetTypes().Length + " interfaces."); | 64 | m_log.Info("[DATA]: Found " + pluginAssembly.GetTypes().Length + " interfaces."); |
64 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 65 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
65 | { | 66 | { |
66 | if (!pluginType.IsAbstract) | 67 | if (!pluginType.IsAbstract) |
@@ -74,7 +75,7 @@ namespace OpenSim.Grid.GridServer | |||
74 | (IGridData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 75 | (IGridData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
75 | plug.Initialise(); | 76 | plug.Initialise(); |
76 | _plugins.Add(plug.getName(), plug); | 77 | _plugins.Add(plug.getName(), plug); |
77 | MainLog.Instance.Verbose("DATA", "Added IGridData Interface"); | 78 | m_log.Info("[DATA]: Added IGridData Interface"); |
78 | } | 79 | } |
79 | 80 | ||
80 | typeInterface = null; | 81 | typeInterface = null; |
@@ -88,7 +89,7 @@ namespace OpenSim.Grid.GridServer | |||
88 | (ILogData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 89 | (ILogData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
89 | plug.Initialise(); | 90 | plug.Initialise(); |
90 | _logplugins.Add(plug.getName(), plug); | 91 | _logplugins.Add(plug.getName(), plug); |
91 | MainLog.Instance.Verbose("DATA", "Added ILogData Interface"); | 92 | m_log.Info("[DATA]: Added ILogData Interface"); |
92 | } | 93 | } |
93 | 94 | ||
94 | typeInterface = null; | 95 | typeInterface = null; |
@@ -116,7 +117,7 @@ namespace OpenSim.Grid.GridServer | |||
116 | } | 117 | } |
117 | catch (Exception) | 118 | catch (Exception) |
118 | { | 119 | { |
119 | MainLog.Instance.Warn("storage", "Unable to write log via " + kvp.Key); | 120 | m_log.Warn("[storage]: Unable to write log via " + kvp.Key); |
120 | } | 121 | } |
121 | } | 122 | } |
122 | } | 123 | } |
@@ -136,7 +137,7 @@ namespace OpenSim.Grid.GridServer | |||
136 | } | 137 | } |
137 | catch (Exception e) | 138 | catch (Exception e) |
138 | { | 139 | { |
139 | MainLog.Instance.Warn("storage", "getRegion - " + e.Message); | 140 | m_log.Warn("[storage]: getRegion - " + e.Message); |
140 | } | 141 | } |
141 | } | 142 | } |
142 | return null; | 143 | return null; |
@@ -157,7 +158,7 @@ namespace OpenSim.Grid.GridServer | |||
157 | } | 158 | } |
158 | catch | 159 | catch |
159 | { | 160 | { |
160 | MainLog.Instance.Warn("storage", "Unable to find region " + handle.ToString() + " via " + kvp.Key); | 161 | m_log.Warn("[storage]: Unable to find region " + handle.ToString() + " via " + kvp.Key); |
161 | } | 162 | } |
162 | } | 163 | } |
163 | return null; | 164 | return null; |
@@ -179,7 +180,7 @@ namespace OpenSim.Grid.GridServer | |||
179 | } | 180 | } |
180 | catch | 181 | catch |
181 | { | 182 | { |
182 | MainLog.Instance.Warn("storage", "Unable to query regionblock via " + kvp.Key); | 183 | m_log.Warn("[storage]: Unable to query regionblock via " + kvp.Key); |
183 | } | 184 | } |
184 | } | 185 | } |
185 | 186 | ||
@@ -245,14 +246,14 @@ namespace OpenSim.Grid.GridServer | |||
245 | } | 246 | } |
246 | else | 247 | else |
247 | { | 248 | { |
248 | MainLog.Instance.Verbose("GRID", "Region connected without a UUID, ignoring."); | 249 | m_log.Info("[GRID]: Region connected without a UUID, ignoring."); |
249 | responseData["error"] = "No UUID passed to grid server - unable to connect you"; | 250 | responseData["error"] = "No UUID passed to grid server - unable to connect you"; |
250 | return response; | 251 | return response; |
251 | } | 252 | } |
252 | 253 | ||
253 | if (TheSim == null) // Shouldnt this be in the REST Simulator Set method? | 254 | if (TheSim == null) // Shouldnt this be in the REST Simulator Set method? |
254 | { | 255 | { |
255 | MainLog.Instance.Verbose("GRID", "New region connecting"); | 256 | m_log.Info("[GRID]: New region connecting"); |
256 | myword = "creation"; | 257 | myword = "creation"; |
257 | } | 258 | } |
258 | else | 259 | else |
@@ -320,7 +321,7 @@ namespace OpenSim.Grid.GridServer | |||
320 | (OldSim.regionRecvKey == TheSim.regionRecvKey && | 321 | (OldSim.regionRecvKey == TheSim.regionRecvKey && |
321 | OldSim.regionSendKey == TheSim.regionSendKey)) | 322 | OldSim.regionSendKey == TheSim.regionSendKey)) |
322 | { | 323 | { |
323 | MainLog.Instance.Verbose("GRID", "Adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + | 324 | m_log.Info("[GRID]: Adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + |
324 | TheSim.serverURI); | 325 | TheSim.serverURI); |
325 | foreach (KeyValuePair<string, IGridData> kvp in _plugins) | 326 | foreach (KeyValuePair<string, IGridData> kvp in _plugins) |
326 | { | 327 | { |
@@ -330,17 +331,17 @@ namespace OpenSim.Grid.GridServer | |||
330 | switch (insertResponse) | 331 | switch (insertResponse) |
331 | { | 332 | { |
332 | case DataResponse.RESPONSE_OK: | 333 | case DataResponse.RESPONSE_OK: |
333 | MainLog.Instance.Verbose("grid", "New sim " + myword + " successful: " + TheSim.regionName); | 334 | m_log.Info("[grid]: New sim " + myword + " successful: " + TheSim.regionName); |
334 | break; | 335 | break; |
335 | case DataResponse.RESPONSE_ERROR: | 336 | case DataResponse.RESPONSE_ERROR: |
336 | MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName); | 337 | m_log.Warn("[storage]: New sim creation failed (Error): " + TheSim.regionName); |
337 | break; | 338 | break; |
338 | case DataResponse.RESPONSE_INVALIDCREDENTIALS: | 339 | case DataResponse.RESPONSE_INVALIDCREDENTIALS: |
339 | MainLog.Instance.Warn("storage", | 340 | m_log.Warn("[storage]: " + |
340 | "New sim creation failed (Invalid Credentials): " + TheSim.regionName); | 341 | "New sim creation failed (Invalid Credentials): " + TheSim.regionName); |
341 | break; | 342 | break; |
342 | case DataResponse.RESPONSE_AUTHREQUIRED: | 343 | case DataResponse.RESPONSE_AUTHREQUIRED: |
343 | MainLog.Instance.Warn("storage", | 344 | m_log.Warn("[storage]: " + |
344 | "New sim creation failed (Authentication Required): " + | 345 | "New sim creation failed (Authentication Required): " + |
345 | TheSim.regionName); | 346 | TheSim.regionName); |
346 | break; | 347 | break; |
@@ -348,9 +349,9 @@ namespace OpenSim.Grid.GridServer | |||
348 | } | 349 | } |
349 | catch (Exception e) | 350 | catch (Exception e) |
350 | { | 351 | { |
351 | MainLog.Instance.Warn("storage", | 352 | m_log.Warn("[storage]: " + |
352 | "Unable to add region " + TheSim.UUID.ToString() + " via " + kvp.Key); | 353 | "Unable to add region " + TheSim.UUID.ToString() + " via " + kvp.Key); |
353 | MainLog.Instance.Warn("storage", e.ToString()); | 354 | m_log.Warn("[storage]: " + e.ToString()); |
354 | } | 355 | } |
355 | 356 | ||
356 | 357 | ||
@@ -458,14 +459,14 @@ namespace OpenSim.Grid.GridServer | |||
458 | } | 459 | } |
459 | else | 460 | else |
460 | { | 461 | { |
461 | MainLog.Instance.Warn("grid", "Authentication failed when trying to add new region " + TheSim.regionName + " at location " + TheSim.regionLocX + " " + TheSim.regionLocY + " currently occupied by " + OldSim.regionName); | 462 | m_log.Warn("[grid]: Authentication failed when trying to add new region " + TheSim.regionName + " at location " + TheSim.regionLocX + " " + TheSim.regionLocY + " currently occupied by " + OldSim.regionName); |
462 | responseData["error"] = "The key required to connect to your region did not match. Please check your send and recieve keys."; | 463 | responseData["error"] = "The key required to connect to your region did not match. Please check your send and recieve keys."; |
463 | return response; | 464 | return response; |
464 | } | 465 | } |
465 | } | 466 | } |
466 | else | 467 | else |
467 | { | 468 | { |
468 | MainLog.Instance.Warn("grid", "Failed to add new region " + TheSim.regionName + " at location " + TheSim.regionLocX + " " + TheSim.regionLocY + " currently occupied by " + OldSim.regionName); | 469 | m_log.Warn("[grid]: Failed to add new region " + TheSim.regionName + " at location " + TheSim.regionLocX + " " + TheSim.regionLocY + " currently occupied by " + OldSim.regionName); |
469 | responseData["error"] = "Another region already exists at that location. Try another"; | 470 | responseData["error"] = "Another region already exists at that location. Try another"; |
470 | return response; | 471 | return response; |
471 | } | 472 | } |
@@ -496,7 +497,7 @@ namespace OpenSim.Grid.GridServer | |||
496 | } | 497 | } |
497 | else | 498 | else |
498 | { | 499 | { |
499 | MainLog.Instance.Verbose("DATA", "found " + (string) simData.regionName + " regionHandle = " + | 500 | m_log.Info("[DATA]: found " + (string) simData.regionName + " regionHandle = " + |
500 | (string) requestData["region_handle"]); | 501 | (string) requestData["region_handle"]); |
501 | responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString(); | 502 | responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString(); |
502 | responseData["sim_port"] = simData.serverPort.ToString(); | 503 | responseData["sim_port"] = simData.serverPort.ToString(); |
@@ -535,8 +536,8 @@ namespace OpenSim.Grid.GridServer | |||
535 | { | 536 | { |
536 | ymax = (Int32) requestData["ymax"]; | 537 | ymax = (Int32) requestData["ymax"]; |
537 | } | 538 | } |
538 | //CFK: The second MainLog is more meaningful and either standard or fast generally occurs. | 539 | //CFK: The second log is more meaningful and either standard or fast generally occurs. |
539 | //CFK: MainLog.Instance.Verbose("MAP", "World map request for range (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); | 540 | //CFK: m_log.Info("[MAP]: World map request for range (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); |
540 | 541 | ||
541 | XmlRpcResponse response = new XmlRpcResponse(); | 542 | XmlRpcResponse response = new XmlRpcResponse(); |
542 | Hashtable responseData = new Hashtable(); | 543 | Hashtable responseData = new Hashtable(); |
@@ -575,7 +576,7 @@ namespace OpenSim.Grid.GridServer | |||
575 | 576 | ||
576 | simProfileList.Add(simProfileBlock); | 577 | simProfileList.Add(simProfileBlock); |
577 | } | 578 | } |
578 | MainLog.Instance.Verbose("MAP", "Fast map " + simProfileList.Count.ToString() + | 579 | m_log.Info("[MAP]: Fast map " + simProfileList.Count.ToString() + |
579 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); | 580 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); |
580 | } | 581 | } |
581 | else | 582 | else |
@@ -610,7 +611,7 @@ namespace OpenSim.Grid.GridServer | |||
610 | } | 611 | } |
611 | } | 612 | } |
612 | } | 613 | } |
613 | MainLog.Instance.Verbose("MAP", "Std map " + simProfileList.Count.ToString() + | 614 | m_log.Info("[MAP]: Std map " + simProfileList.Count.ToString() + |
614 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); | 615 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); |
615 | } | 616 | } |
616 | 617 | ||
@@ -776,7 +777,7 @@ namespace OpenSim.Grid.GridServer | |||
776 | 777 | ||
777 | try | 778 | try |
778 | { | 779 | { |
779 | MainLog.Instance.Verbose("DATA", | 780 | m_log.Info("[DATA]: " + |
780 | "Updating / adding via " + _plugins.Count + " storage provider(s) registered."); | 781 | "Updating / adding via " + _plugins.Count + " storage provider(s) registered."); |
781 | foreach (KeyValuePair<string, IGridData> kvp in _plugins) | 782 | foreach (KeyValuePair<string, IGridData> kvp in _plugins) |
782 | { | 783 | { |
@@ -789,13 +790,13 @@ namespace OpenSim.Grid.GridServer | |||
789 | (reserveData == null && authkeynode.InnerText != TheSim.regionRecvKey)) | 790 | (reserveData == null && authkeynode.InnerText != TheSim.regionRecvKey)) |
790 | { | 791 | { |
791 | kvp.Value.AddProfile(TheSim); | 792 | kvp.Value.AddProfile(TheSim); |
792 | MainLog.Instance.Verbose("grid", "New sim added to grid (" + TheSim.regionName + ")"); | 793 | m_log.Info("[grid]: New sim added to grid (" + TheSim.regionName + ")"); |
793 | logToDB(TheSim.UUID.ToString(), "RestSetSimMethod", String.Empty, 5, | 794 | logToDB(TheSim.UUID.ToString(), "RestSetSimMethod", String.Empty, 5, |
794 | "Region successfully updated and connected to grid."); | 795 | "Region successfully updated and connected to grid."); |
795 | } | 796 | } |
796 | else | 797 | else |
797 | { | 798 | { |
798 | MainLog.Instance.Warn("grid", | 799 | m_log.Warn("[grid]: " + |
799 | "Unable to update region (RestSetSimMethod): Incorrect reservation auth key."); | 800 | "Unable to update region (RestSetSimMethod): Incorrect reservation auth key."); |
800 | // Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + "."); | 801 | // Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + "."); |
801 | return "Unable to update region (RestSetSimMethod): Incorrect auth key."; | 802 | return "Unable to update region (RestSetSimMethod): Incorrect auth key."; |
@@ -803,7 +804,7 @@ namespace OpenSim.Grid.GridServer | |||
803 | } | 804 | } |
804 | catch (Exception e) | 805 | catch (Exception e) |
805 | { | 806 | { |
806 | MainLog.Instance.Warn("GRID", "getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + | 807 | m_log.Warn("[GRID]: getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + |
807 | e.ToString()); | 808 | e.ToString()); |
808 | } | 809 | } |
809 | } | 810 | } |
diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 8a522c2..ff4a888 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs | |||
@@ -39,6 +39,8 @@ namespace OpenSim.Grid.GridServer | |||
39 | /// </summary> | 39 | /// </summary> |
40 | public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback | 40 | public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
42 | public GridConfig Cfg; | 44 | public GridConfig Cfg; |
43 | 45 | ||
44 | public static OpenGrid_Main thegrid; | 46 | public static OpenGrid_Main thegrid; |
@@ -54,11 +56,13 @@ namespace OpenSim.Grid.GridServer | |||
54 | [STAThread] | 56 | [STAThread] |
55 | public static void Main(string[] args) | 57 | public static void Main(string[] args) |
56 | { | 58 | { |
59 | log4net.Config.XmlConfigurator.Configure(); | ||
60 | |||
57 | if (args.Length > 0) | 61 | if (args.Length > 0) |
58 | { | 62 | { |
59 | if (args[0] == "-setuponly") setuponly = true; | 63 | if (args[0] == "-setuponly") setuponly = true; |
60 | } | 64 | } |
61 | Console.WriteLine("Starting...\n"); | 65 | m_log.Info("Starting...\n"); |
62 | 66 | ||
63 | thegrid = new OpenGrid_Main(); | 67 | thegrid = new OpenGrid_Main(); |
64 | thegrid.Startup(); | 68 | thegrid.Startup(); |
@@ -68,23 +72,18 @@ namespace OpenSim.Grid.GridServer | |||
68 | 72 | ||
69 | private void Work() | 73 | private void Work() |
70 | { | 74 | { |
71 | m_log.Notice("Enter help for a list of commands\n"); | 75 | m_console.Notice("Enter help for a list of commands\n"); |
72 | 76 | ||
73 | while (true) | 77 | while (true) |
74 | { | 78 | { |
75 | m_log.MainLogPrompt(); | 79 | m_console.Prompt(); |
76 | } | 80 | } |
77 | } | 81 | } |
78 | 82 | ||
79 | private OpenGrid_Main() | 83 | private OpenGrid_Main() |
80 | { | 84 | { |
81 | if (!Directory.Exists(Util.logDir())) | 85 | m_console = new ConsoleBase("OpenGrid", this); |
82 | { | 86 | MainConsole.Instance = m_console; |
83 | Directory.CreateDirectory(Util.logDir()); | ||
84 | } | ||
85 | m_log = | ||
86 | new LogBase((Path.Combine(Util.logDir(), "opengrid-gridserver-console.log")), "OpenGrid", this, true); | ||
87 | MainLog.Instance = m_log; | ||
88 | } | 87 | } |
89 | 88 | ||
90 | public void managercallback(string cmd) | 89 | public void managercallback(string cmd) |
@@ -97,19 +96,18 @@ namespace OpenSim.Grid.GridServer | |||
97 | } | 96 | } |
98 | } | 97 | } |
99 | 98 | ||
100 | |||
101 | public void Startup() | 99 | public void Startup() |
102 | { | 100 | { |
103 | Cfg = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); | 101 | Cfg = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); |
104 | //Yeah srsly, that's it. | 102 | //Yeah srsly, that's it. |
105 | if (setuponly) Environment.Exit(0); | 103 | if (setuponly) Environment.Exit(0); |
106 | 104 | ||
107 | m_log.Verbose("GRID", "Connecting to Storage Server"); | 105 | m_log.Info("[GRID]: Connecting to Storage Server"); |
108 | m_gridManager = new GridManager(); | 106 | m_gridManager = new GridManager(); |
109 | m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win | 107 | m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win |
110 | m_gridManager.config = Cfg; | 108 | m_gridManager.config = Cfg; |
111 | 109 | ||
112 | m_log.Verbose("GRID", "Starting HTTP process"); | 110 | m_log.Info("[GRID]: Starting HTTP process"); |
113 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); | 111 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); |
114 | //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); | 112 | //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); |
115 | 113 | ||
@@ -135,7 +133,7 @@ namespace OpenSim.Grid.GridServer | |||
135 | 133 | ||
136 | httpServer.Start(); | 134 | httpServer.Start(); |
137 | 135 | ||
138 | m_log.Verbose("GRID", "Starting sim status checker"); | 136 | m_log.Info("[GRID]: Starting sim status checker"); |
139 | 137 | ||
140 | Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates. | 138 | Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates. |
141 | simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); | 139 | simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); |
@@ -186,11 +184,11 @@ namespace OpenSim.Grid.GridServer | |||
186 | switch (cmd) | 184 | switch (cmd) |
187 | { | 185 | { |
188 | case "help": | 186 | case "help": |
189 | m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | 187 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); |
190 | break; | 188 | break; |
191 | 189 | ||
192 | case "shutdown": | 190 | case "shutdown": |
193 | m_log.Close(); | 191 | m_console.Close(); |
194 | Environment.Exit(0); | 192 | Environment.Exit(0); |
195 | break; | 193 | break; |
196 | } | 194 | } |
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index d36a915..a719452 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs | |||
@@ -37,6 +37,8 @@ namespace OpenSim.Grid.InventoryServer | |||
37 | { | 37 | { |
38 | public class GridInventoryService : InventoryServiceBase | 38 | public class GridInventoryService : InventoryServiceBase |
39 | { | 39 | { |
40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
40 | public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, | 42 | public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, |
41 | InventoryItemInfo itemCallBack) | 43 | InventoryItemInfo itemCallBack) |
42 | { | 44 | { |
@@ -108,7 +110,7 @@ namespace OpenSim.Grid.InventoryServer | |||
108 | LLUUID userID = new LLUUID(rawUserID); | 110 | LLUUID userID = new LLUUID(rawUserID); |
109 | 111 | ||
110 | // We get enough verbose messages later on for diagnostics | 112 | // We get enough verbose messages later on for diagnostics |
111 | //MainLog.Instance.Verbose("INVENTORY", "Request for inventory for " + userID.ToString()); | 113 | //m_log.Info("[INVENTORY]: Request for inventory for " + userID.ToString()); |
112 | 114 | ||
113 | InventoryCollection invCollection = new InventoryCollection(); | 115 | InventoryCollection invCollection = new InventoryCollection(); |
114 | List<InventoryFolderBase> folders; | 116 | List<InventoryFolderBase> folders; |
@@ -126,8 +128,8 @@ namespace OpenSim.Grid.InventoryServer | |||
126 | { | 128 | { |
127 | LLUUID userID = new LLUUID(rawUserID); | 129 | LLUUID userID = new LLUUID(rawUserID); |
128 | 130 | ||
129 | MainLog.Instance.Verbose( | 131 | m_log.Info( |
130 | "INVENTORY", "Creating new set of inventory folders for " + userID.ToString()); | 132 | "[INVENTORY]: Creating new set of inventory folders for " + userID.ToString()); |
131 | 133 | ||
132 | CreateNewUserInventory(userID); | 134 | CreateNewUserInventory(userID); |
133 | return true; | 135 | return true; |
@@ -152,8 +154,8 @@ namespace OpenSim.Grid.InventoryServer | |||
152 | public bool AddInventoryFolder(InventoryFolderBase folder) | 154 | public bool AddInventoryFolder(InventoryFolderBase folder) |
153 | { | 155 | { |
154 | // Right now, this actions act more like an update/insert combination than a simple create. | 156 | // Right now, this actions act more like an update/insert combination than a simple create. |
155 | MainLog.Instance.Verbose( | 157 | m_log.Info( |
156 | "INVENTORY", | 158 | "[INVENTORY]: " + |
157 | "Updating in " + folder.parentID.ToString() | 159 | "Updating in " + folder.parentID.ToString() |
158 | + ", folder " + folder.name); | 160 | + ", folder " + folder.name); |
159 | 161 | ||
@@ -163,8 +165,8 @@ namespace OpenSim.Grid.InventoryServer | |||
163 | 165 | ||
164 | public bool MoveInventoryFolder(InventoryFolderBase folder) | 166 | public bool MoveInventoryFolder(InventoryFolderBase folder) |
165 | { | 167 | { |
166 | MainLog.Instance.Verbose( | 168 | m_log.Info( |
167 | "INVENTORY", | 169 | "[INVENTORY]: " + |
168 | "Moving folder " + folder.folderID | 170 | "Moving folder " + folder.folderID |
169 | + " to " + folder.parentID.ToString()); | 171 | + " to " + folder.parentID.ToString()); |
170 | 172 | ||
@@ -175,8 +177,8 @@ namespace OpenSim.Grid.InventoryServer | |||
175 | public bool AddInventoryItem(InventoryItemBase item) | 177 | public bool AddInventoryItem(InventoryItemBase item) |
176 | { | 178 | { |
177 | // Right now, this actions act more like an update/insert combination than a simple create. | 179 | // Right now, this actions act more like an update/insert combination than a simple create. |
178 | MainLog.Instance.Verbose( | 180 | m_log.Info( |
179 | "INVENTORY", | 181 | "[INVENTORY]: " + |
180 | "Updating in " + item.parentFolderID.ToString() | 182 | "Updating in " + item.parentFolderID.ToString() |
181 | + ", item " + item.inventoryName); | 183 | + ", item " + item.inventoryName); |
182 | 184 | ||
@@ -187,8 +189,8 @@ namespace OpenSim.Grid.InventoryServer | |||
187 | public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | 189 | public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) |
188 | { | 190 | { |
189 | // extra spaces to align with other inventory messages | 191 | // extra spaces to align with other inventory messages |
190 | MainLog.Instance.Verbose( | 192 | m_log.Info( |
191 | "INVENTORY", | 193 | "[INVENTORY]: " + |
192 | "Deleting in " + item.parentFolderID.ToString() | 194 | "Deleting in " + item.parentFolderID.ToString() |
193 | + ", item " + item.inventoryName); | 195 | + ", item " + item.inventoryName); |
194 | 196 | ||
diff --git a/OpenSim/Grid/InventoryServer/InventoryManager.cs b/OpenSim/Grid/InventoryServer/InventoryManager.cs index 6ca5064..35b66b2 100644 --- a/OpenSim/Grid/InventoryServer/InventoryManager.cs +++ b/OpenSim/Grid/InventoryServer/InventoryManager.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Grid.InventoryServer | |||
41 | { | 41 | { |
42 | public class InventoryManager | 42 | public class InventoryManager |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | private IInventoryData _databasePlugin; | 46 | private IInventoryData _databasePlugin; |
45 | 47 | ||
46 | /// <summary> | 48 | /// <summary> |
@@ -49,10 +51,10 @@ namespace OpenSim.Grid.InventoryServer | |||
49 | /// <param name="FileName">The filename to the inventory server plugin DLL</param> | 51 | /// <param name="FileName">The filename to the inventory server plugin DLL</param> |
50 | public void AddDatabasePlugin(string FileName) | 52 | public void AddDatabasePlugin(string FileName) |
51 | { | 53 | { |
52 | MainLog.Instance.Verbose(OpenInventory_Main.LogName, "Invenstorage: Attempting to load " + FileName); | 54 | m_log.Info("[" + OpenInventory_Main.LogName + "]: Invenstorage: Attempting to load " + FileName); |
53 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 55 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
54 | 56 | ||
55 | MainLog.Instance.Verbose(OpenInventory_Main.LogName, | 57 | m_log.Info("[" + OpenInventory_Main.LogName + "]: " + |
56 | "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); | 58 | "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); |
57 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 59 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
58 | { | 60 | { |
@@ -66,7 +68,7 @@ namespace OpenSim.Grid.InventoryServer | |||
66 | (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 68 | (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
67 | plug.Initialise(); | 69 | plug.Initialise(); |
68 | _databasePlugin = plug; | 70 | _databasePlugin = plug; |
69 | MainLog.Instance.Verbose(OpenInventory_Main.LogName, | 71 | m_log.Info("[" + OpenInventory_Main.LogName + "]: " + |
70 | "Invenstorage: Added IInventoryData Interface"); | 72 | "Invenstorage: Added IInventoryData Interface"); |
71 | break; | 73 | break; |
72 | } | 74 | } |
@@ -156,7 +158,7 @@ namespace OpenSim.Grid.InventoryServer | |||
156 | saveInventoryToStream(_inventory, fs); | 158 | saveInventoryToStream(_inventory, fs); |
157 | fs.Flush(); | 159 | fs.Flush(); |
158 | fs.Close(); | 160 | fs.Close(); |
159 | MainLog.Instance.Debug(OpenInventory_Main.LogName, "Modified"); | 161 | m_log.Debug("[" + OpenInventory_Main.LogName + "]: Modified"); |
160 | } | 162 | } |
161 | } | 163 | } |
162 | 164 | ||
@@ -166,14 +168,14 @@ namespace OpenSim.Grid.InventoryServer | |||
166 | 168 | ||
167 | private byte[] GetUserInventory(LLUUID userID) | 169 | private byte[] GetUserInventory(LLUUID userID) |
168 | { | 170 | { |
169 | MainLog.Instance.Notice(OpenInventory_Main.LogName, "Getting Inventory for user {0}", userID.ToString()); | 171 | m_log.Info(String.Format("[" + OpenInventory_Main.LogName + "]: Getting Inventory for user {0}", userID.ToString())); |
170 | byte[] result = new byte[] {}; | 172 | byte[] result = new byte[] {}; |
171 | 173 | ||
172 | InventoryFolderBase fb = _manager._databasePlugin.getUserRootFolder(userID); | 174 | InventoryFolderBase fb = _manager._databasePlugin.getUserRootFolder(userID); |
173 | if (fb == null) | 175 | if (fb == null) |
174 | { | 176 | { |
175 | MainLog.Instance.Notice(OpenInventory_Main.LogName, "Inventory not found for user {0}, creating new", | 177 | m_log.Info(String.Format("[" + OpenInventory_Main.LogName + "]: Inventory not found for user {0}, creating new", |
176 | userID.ToString()); | 178 | userID.ToString())); |
177 | CreateDefaultInventory(userID); | 179 | CreateDefaultInventory(userID); |
178 | } | 180 | } |
179 | 181 | ||
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index b62c696..5037c7d 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -38,6 +38,8 @@ namespace OpenSim.Grid.InventoryServer | |||
38 | { | 38 | { |
39 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback | 39 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback |
40 | { | 40 | { |
41 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
42 | |||
41 | private InventoryManager m_inventoryManager; | 43 | private InventoryManager m_inventoryManager; |
42 | private InventoryConfig m_config; | 44 | private InventoryConfig m_config; |
43 | private GridInventoryService m_inventoryService; | 45 | private GridInventoryService m_inventoryService; |
@@ -47,6 +49,8 @@ namespace OpenSim.Grid.InventoryServer | |||
47 | [STAThread] | 49 | [STAThread] |
48 | public static void Main(string[] args) | 50 | public static void Main(string[] args) |
49 | { | 51 | { |
52 | log4net.Config.XmlConfigurator.Configure(); | ||
53 | |||
50 | OpenInventory_Main theServer = new OpenInventory_Main(); | 54 | OpenInventory_Main theServer = new OpenInventory_Main(); |
51 | theServer.Startup(); | 55 | theServer.Startup(); |
52 | 56 | ||
@@ -55,20 +59,20 @@ namespace OpenSim.Grid.InventoryServer | |||
55 | 59 | ||
56 | public OpenInventory_Main() | 60 | public OpenInventory_Main() |
57 | { | 61 | { |
58 | m_log = new LogBase("opengrid-inventory-console.log", LogName, this, true); | 62 | m_console = new ConsoleBase(LogName, this); |
59 | MainLog.Instance = m_log; | 63 | MainConsole.Instance = m_console; |
60 | } | 64 | } |
61 | 65 | ||
62 | public void Startup() | 66 | public void Startup() |
63 | { | 67 | { |
64 | MainLog.Instance.Notice("Initialising inventory manager..."); | 68 | m_log.Info("Initialising inventory manager..."); |
65 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); | 69 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); |
66 | 70 | ||
67 | m_inventoryService = new GridInventoryService(); | 71 | m_inventoryService = new GridInventoryService(); |
68 | // m_inventoryManager = new InventoryManager(); | 72 | // m_inventoryManager = new InventoryManager(); |
69 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); | 73 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); |
70 | 74 | ||
71 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); | 75 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
72 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 76 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); |
73 | httpServer.AddStreamHandler( | 77 | httpServer.AddStreamHandler( |
74 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", | 78 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", |
@@ -95,19 +99,19 @@ namespace OpenSim.Grid.InventoryServer | |||
95 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", | 99 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", |
96 | m_inventoryService.RequestFirstLevelFolders)); | 100 | m_inventoryService.RequestFirstLevelFolders)); |
97 | 101 | ||
98 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); | 102 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); |
99 | 103 | ||
100 | httpServer.Start(); | 104 | httpServer.Start(); |
101 | MainLog.Instance.Notice(LogName, "Started HTTP server"); | 105 | m_log.Info("[" + LogName + "]: Started HTTP server"); |
102 | } | 106 | } |
103 | 107 | ||
104 | private void Work() | 108 | private void Work() |
105 | { | 109 | { |
106 | m_log.Notice("Enter help for a list of commands\n"); | 110 | m_console.Notice("Enter help for a list of commands\n"); |
107 | 111 | ||
108 | while (true) | 112 | while (true) |
109 | { | 113 | { |
110 | m_log.MainLogPrompt(); | 114 | m_console.Prompt(); |
111 | } | 115 | } |
112 | } | 116 | } |
113 | 117 | ||
@@ -122,7 +126,7 @@ namespace OpenSim.Grid.InventoryServer | |||
122 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); | 126 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); |
123 | break; | 127 | break; |
124 | case "shutdown": | 128 | case "shutdown": |
125 | m_log.Close(); | 129 | m_console.Close(); |
126 | Environment.Exit(0); | 130 | Environment.Exit(0); |
127 | break; | 131 | break; |
128 | } | 132 | } |
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index 3d5ceb4..c16b0f8 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Grid.MessagingServer | |||
41 | /// </summary> | 41 | /// </summary> |
42 | public class OpenMessage_Main : BaseOpenSimServer, conscmd_callback | 42 | public class OpenMessage_Main : BaseOpenSimServer, conscmd_callback |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | private MessageServerConfig Cfg; | 46 | private MessageServerConfig Cfg; |
45 | 47 | ||
46 | //public UserManager m_userManager; | 48 | //public UserManager m_userManager; |
@@ -51,7 +53,9 @@ namespace OpenSim.Grid.MessagingServer | |||
51 | [STAThread] | 53 | [STAThread] |
52 | public static void Main(string[] args) | 54 | public static void Main(string[] args) |
53 | { | 55 | { |
54 | Console.WriteLine("Launching MessagingServer..."); | 56 | log4net.Config.XmlConfigurator.Configure(); |
57 | |||
58 | m_log.Info("Launching MessagingServer..."); | ||
55 | 59 | ||
56 | OpenMessage_Main messageserver = new OpenMessage_Main(); | 60 | OpenMessage_Main messageserver = new OpenMessage_Main(); |
57 | 61 | ||
@@ -61,22 +65,17 @@ namespace OpenSim.Grid.MessagingServer | |||
61 | 65 | ||
62 | private OpenMessage_Main() | 66 | private OpenMessage_Main() |
63 | { | 67 | { |
64 | if (!Directory.Exists(Util.logDir())) | 68 | m_console = new ConsoleBase("OpenMessage", this); |
65 | { | 69 | MainConsole.Instance = m_console; |
66 | Directory.CreateDirectory(Util.logDir()); | ||
67 | } | ||
68 | m_log = | ||
69 | new LogBase((Path.Combine(Util.logDir(), "opengrid-messagingserver-console.log")), "OpenMessage", this, true); | ||
70 | MainLog.Instance = m_log; | ||
71 | } | 70 | } |
72 | 71 | ||
73 | private void Work() | 72 | private void Work() |
74 | { | 73 | { |
75 | m_log.Notice("Enter help for a list of commands\n"); | 74 | m_console.Notice("Enter help for a list of commands\n"); |
76 | 75 | ||
77 | while (true) | 76 | while (true) |
78 | { | 77 | { |
79 | m_log.MainLogPrompt(); | 78 | m_console.Prompt(); |
80 | } | 79 | } |
81 | } | 80 | } |
82 | 81 | ||
@@ -84,9 +83,7 @@ namespace OpenSim.Grid.MessagingServer | |||
84 | { | 83 | { |
85 | Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); | 84 | Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); |
86 | 85 | ||
87 | 86 | m_log.Info("[REGION]: Starting HTTP process"); | |
88 | |||
89 | MainLog.Instance.Verbose("REGION", "Starting HTTP process"); | ||
90 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); | 87 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); |
91 | 88 | ||
92 | //httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); | 89 | //httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); |
@@ -104,10 +101,9 @@ namespace OpenSim.Grid.MessagingServer | |||
104 | //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); | 101 | //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); |
105 | 102 | ||
106 | httpServer.Start(); | 103 | httpServer.Start(); |
107 | m_log.Status("SERVER", "Messageserver 0.4 - Startup complete"); | 104 | m_log.Info("[SERVER]: Messageserver 0.4 - Startup complete"); |
108 | } | 105 | } |
109 | 106 | ||
110 | |||
111 | public void do_create(string what) | 107 | public void do_create(string what) |
112 | { | 108 | { |
113 | switch (what) | 109 | switch (what) |
@@ -120,7 +116,7 @@ namespace OpenSim.Grid.MessagingServer | |||
120 | //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 116 | //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
121 | } catch (Exception ex) | 117 | } catch (Exception ex) |
122 | { | 118 | { |
123 | m_log.Error("SERVER", "Error creating user: {0}", ex.ToString()); | 119 | m_console.Error("[SERVER]: Error creating user: {0}", ex.ToString()); |
124 | } | 120 | } |
125 | 121 | ||
126 | try | 122 | try |
@@ -130,9 +126,9 @@ namespace OpenSim.Grid.MessagingServer | |||
130 | } | 126 | } |
131 | catch (Exception ex) | 127 | catch (Exception ex) |
132 | { | 128 | { |
133 | m_log.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); | 129 | m_console.Error("[SERVER]: Error creating inventory for user: {0}", ex.ToString()); |
134 | } | 130 | } |
135 | // m_lastCreatedUser = userID; | 131 | // m_lastCreatedUser = userID; |
136 | break; | 132 | break; |
137 | } | 133 | } |
138 | } | 134 | } |
@@ -144,11 +140,11 @@ namespace OpenSim.Grid.MessagingServer | |||
144 | switch (cmd) | 140 | switch (cmd) |
145 | { | 141 | { |
146 | case "help": | 142 | case "help": |
147 | m_log.Notice("shutdown - shutdown the message server (USE CAUTION!)"); | 143 | m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)"); |
148 | break; | 144 | break; |
149 | 145 | ||
150 | case "shutdown": | 146 | case "shutdown": |
151 | m_log.Close(); | 147 | m_console.Close(); |
152 | Environment.Exit(0); | 148 | Environment.Exit(0); |
153 | break; | 149 | break; |
154 | } | 150 | } |
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 | |||
43 | { | 43 | { |
44 | public class MessageService | 44 | public class MessageService |
45 | { | 45 | { |
46 | private LogBase m_log; | 46 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
47 | |||
47 | private MessageServerConfig m_cfg; | 48 | private MessageServerConfig m_cfg; |
48 | 49 | ||
49 | //A hashtable of all current presences this server knows about | 50 | //A hashtable of all current presences this server knows about |
@@ -58,13 +59,10 @@ namespace OpenSim.Grid.MessagingServer | |||
58 | // Hashtable containing work units that need to be processed | 59 | // Hashtable containing work units that need to be processed |
59 | private Hashtable m_unProcessedWorkUnits = new Hashtable(); | 60 | private Hashtable m_unProcessedWorkUnits = new Hashtable(); |
60 | 61 | ||
61 | 62 | public MessageService(MessageServerConfig cfg) | |
62 | public MessageService(LogBase log, MessageServerConfig cfg) | ||
63 | { | 63 | { |
64 | m_log = log; | ||
65 | m_cfg = cfg; | 64 | m_cfg = cfg; |
66 | } | 65 | } |
67 | |||
68 | 66 | ||
69 | #region RegionComms Methods | 67 | #region RegionComms Methods |
70 | 68 | ||
@@ -84,7 +82,7 @@ namespace OpenSim.Grid.MessagingServer | |||
84 | ArrayList SendParams = new ArrayList(); | 82 | ArrayList SendParams = new ArrayList(); |
85 | SendParams.Add(PresenceParams); | 83 | SendParams.Add(PresenceParams); |
86 | 84 | ||
87 | MainLog.Instance.Verbose("PRESENCE", "Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); | 85 | m_log.Info("[PRESENCE]: Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); |
88 | // Send | 86 | // Send |
89 | XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); | 87 | XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); |
90 | XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); | 88 | XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); |
@@ -292,7 +290,7 @@ namespace OpenSim.Grid.MessagingServer | |||
292 | } | 290 | } |
293 | catch (WebException e) | 291 | catch (WebException e) |
294 | { | 292 | { |
295 | MainLog.Instance.Warn("Error when trying to fetch Avatar's friends list: " + | 293 | m_log.Warn("Error when trying to fetch Avatar's friends list: " + |
296 | e.Message); | 294 | e.Message); |
297 | // Return Empty list (no friends) | 295 | // Return Empty list (no friends) |
298 | } | 296 | } |
@@ -439,7 +437,7 @@ namespace OpenSim.Grid.MessagingServer | |||
439 | 437 | ||
440 | if (responseData.ContainsKey("error")) | 438 | if (responseData.ContainsKey("error")) |
441 | { | 439 | { |
442 | m_log.Error("GRID","error received from grid server" + responseData["error"]); | 440 | m_log.Error("[GRID]: error received from grid server" + responseData["error"]); |
443 | return null; | 441 | return null; |
444 | } | 442 | } |
445 | 443 | ||
@@ -465,7 +463,7 @@ namespace OpenSim.Grid.MessagingServer | |||
465 | } | 463 | } |
466 | catch (WebException) | 464 | catch (WebException) |
467 | { | 465 | { |
468 | MainLog.Instance.Error("GRID", | 466 | m_log.Error("[GRID]: " + |
469 | "Region lookup failed for: " + regionHandle.ToString() + | 467 | "Region lookup failed for: " + regionHandle.ToString() + |
470 | " - Is the GridServer down?"); | 468 | " - Is the GridServer down?"); |
471 | return null; | 469 | return null; |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs index 98a2cc5..bcfeefc 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Common.cs | |||
@@ -26,10 +26,13 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | |||
29 | namespace OpenSim.Grid.ScriptEngine.DotNetEngine | 30 | namespace OpenSim.Grid.ScriptEngine.DotNetEngine |
30 | { | 31 | { |
31 | public static class Common | 32 | public static class Common |
32 | { | 33 | { |
34 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
35 | |||
33 | public static bool debug = true; | 36 | public static bool debug = true; |
34 | public static ScriptEngine mySE; | 37 | public static ScriptEngine mySE; |
35 | 38 | ||
@@ -41,14 +44,14 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
41 | public static void SendToDebug(string Message) | 44 | public static void SendToDebug(string Message) |
42 | { | 45 | { |
43 | //if (Debug == true) | 46 | //if (Debug == true) |
44 | mySE.Log.Verbose("ScriptEngine", "Debug: " + Message); | 47 | mySE.m_log.Info("[ScriptEngine]: Debug: " + Message); |
45 | //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | 48 | //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); |
46 | } | 49 | } |
47 | 50 | ||
48 | public static void SendToLog(string Message) | 51 | public static void SendToLog(string Message) |
49 | { | 52 | { |
50 | //if (Debug == true) | 53 | //if (Debug == true) |
51 | mySE.Log.Verbose("ScriptEngine", "LOG: " + Message); | 54 | mySE.m_log.Info("[ScriptEngine]: LOG: " + Message); |
52 | //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); | 55 | //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); |
53 | } | 56 | } |
54 | } | 57 | } |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 1f5e6da..e0a5461 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL | |||
41 | //[Serializable] | 41 | //[Serializable] |
42 | public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript | 42 | public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | // Object never expires | 46 | // Object never expires |
45 | public override Object InitializeLifetimeService() | 47 | public override Object InitializeLifetimeService() |
46 | { | 48 | { |
@@ -87,7 +89,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL | |||
87 | { | 89 | { |
88 | m_LSL_Functions = LSL_Functions; | 90 | m_LSL_Functions = LSL_Functions; |
89 | 91 | ||
90 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called."); | 92 | //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called."); |
91 | 93 | ||
92 | // Get this AppDomain's settings and display some of them. | 94 | // Get this AppDomain's settings and display some of them. |
93 | AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; | 95 | AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 8f58b55..1ffbd3a 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -52,6 +52,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler | |||
52 | /// </summary> | 52 | /// </summary> |
53 | public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface | 53 | public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface |
54 | { | 54 | { |
55 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
56 | |||
55 | private ASCIIEncoding enc = new ASCIIEncoding(); | 57 | private ASCIIEncoding enc = new ASCIIEncoding(); |
56 | private ScriptEngine m_ScriptEngine; | 58 | private ScriptEngine m_ScriptEngine; |
57 | private SceneObjectPart m_host; | 59 | private SceneObjectPart m_host; |
@@ -68,7 +70,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler | |||
68 | m_itemID = itemID; | 70 | m_itemID = itemID; |
69 | 71 | ||
70 | 72 | ||
71 | //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); | 73 | //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); |
72 | } | 74 | } |
73 | 75 | ||
74 | 76 | ||
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs index 3a1ae5a..3aa2216 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventManager.cs | |||
@@ -38,17 +38,19 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
38 | [Serializable] | 38 | [Serializable] |
39 | internal class EventManager | 39 | internal class EventManager |
40 | { | 40 | { |
41 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
42 | |||
41 | private ScriptEngine myScriptEngine; | 43 | private ScriptEngine myScriptEngine; |
42 | //public IScriptHost TEMP_OBJECT_ID; | 44 | //public IScriptHost TEMP_OBJECT_ID; |
43 | public EventManager(ScriptEngine _ScriptEngine) | 45 | public EventManager(ScriptEngine _ScriptEngine) |
44 | { | 46 | { |
45 | myScriptEngine = _ScriptEngine; | 47 | myScriptEngine = _ScriptEngine; |
46 | // TODO: HOOK EVENTS UP TO SERVER! | 48 | // TODO: HOOK EVENTS UP TO SERVER! |
47 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start"); | 49 | //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Start"); |
48 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager | 50 | // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager |
49 | 51 | ||
50 | // Hook up a test event to our test form | 52 | // Hook up a test event to our test form |
51 | myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); | 53 | myScriptEngine.m_log.Info("[ScriptEngine]: Hooking up to server events"); |
52 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; | 54 | myScriptEngine.World.EventManager.OnObjectGrab += touch_start; |
53 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 55 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
54 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 56 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; |
@@ -57,7 +59,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
57 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 59 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
58 | { | 60 | { |
59 | // Add to queue for all scripts in ObjectID object | 61 | // Add to queue for all scripts in ObjectID object |
60 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); | 62 | //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Event: touch_start"); |
61 | //Console.WriteLine("touch_start localID: " + localID); | 63 | //Console.WriteLine("touch_start localID: " + localID); |
62 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); | 64 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); |
63 | } | 65 | } |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs index d9d26aa..2606862 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/EventQueueManager.cs | |||
@@ -44,6 +44,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
44 | [Serializable] | 44 | [Serializable] |
45 | internal class EventQueueManager | 45 | internal class EventQueueManager |
46 | { | 46 | { |
47 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
47 | /// <summary> | 49 | /// <summary> |
48 | /// List of threads processing event queue | 50 | /// List of threads processing event queue |
49 | /// </summary> | 51 | /// </summary> |
@@ -118,7 +120,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
118 | } | 120 | } |
119 | catch (Exception) | 121 | catch (Exception) |
120 | { | 122 | { |
121 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString()); | 123 | //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Exception killing worker thread: " + e.ToString()); |
122 | } | 124 | } |
123 | } | 125 | } |
124 | } | 126 | } |
@@ -132,7 +134,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
132 | /// </summary> | 134 | /// </summary> |
133 | private void EventQueueThreadLoop() | 135 | private void EventQueueThreadLoop() |
134 | { | 136 | { |
135 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned"); | 137 | //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread spawned"); |
136 | try | 138 | try |
137 | { | 139 | { |
138 | QueueItemStruct BlankQIS = new QueueItemStruct(); | 140 | QueueItemStruct BlankQIS = new QueueItemStruct(); |
@@ -151,7 +153,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
151 | else | 153 | else |
152 | { | 154 | { |
153 | // Something in queue, process | 155 | // Something in queue, process |
154 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); | 156 | //myScriptEngine.m_log.Info("[ScriptEngine]: Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); |
155 | 157 | ||
156 | // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD | 158 | // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD |
157 | lock (queueLock) | 159 | lock (queueLock) |
@@ -237,7 +239,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
237 | } // try | 239 | } // try |
238 | catch (ThreadAbortException) | 240 | catch (ThreadAbortException) |
239 | { | 241 | { |
240 | //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message); | 242 | //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread killed: " + tae.Message); |
241 | } | 243 | } |
242 | } | 244 | } |
243 | 245 | ||
@@ -287,7 +289,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
287 | public void AddToObjectQueue(uint localID, string FunctionName, object[] param) | 289 | public void AddToObjectQueue(uint localID, string FunctionName, object[] param) |
288 | { | 290 | { |
289 | // Determine all scripts in Object and add to their queue | 291 | // Determine all scripts in Object and add to their queue |
290 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); | 292 | //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); |
291 | 293 | ||
292 | 294 | ||
293 | // Do we have any scripts in this object at all? If not, return | 295 | // Do we have any scripts in this object at all? If not, return |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs index cc6cde2..a45efe9 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -40,6 +40,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
40 | [Serializable] | 40 | [Serializable] |
41 | public class ScriptEngine : IRegionModule | 41 | public class ScriptEngine : IRegionModule |
42 | { | 42 | { |
43 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | |||
43 | internal Scene World; | 45 | internal Scene World; |
44 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim | 46 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim |
45 | internal EventQueueManager m_EventQueueManager; // Executes events | 47 | internal EventQueueManager m_EventQueueManager; // Executes events |
@@ -47,7 +49,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
47 | internal AppDomainManager m_AppDomainManager; | 49 | internal AppDomainManager m_AppDomainManager; |
48 | internal LSLLongCmdHandler m_LSLLongCmdHandler; | 50 | internal LSLLongCmdHandler m_LSLLongCmdHandler; |
49 | 51 | ||
50 | private LogBase m_log; | ||
51 | 52 | ||
52 | public ScriptEngine() | 53 | public ScriptEngine() |
53 | { | 54 | { |
@@ -55,19 +56,13 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
55 | Common.mySE = this; | 56 | Common.mySE = this; |
56 | } | 57 | } |
57 | 58 | ||
58 | public LogBase Log | 59 | public void InitializeEngine(Scene Sceneworld) |
59 | { | ||
60 | get { return m_log; } | ||
61 | } | ||
62 | |||
63 | public void InitializeEngine(Scene Sceneworld, LogBase logger) | ||
64 | { | 60 | { |
65 | World = Sceneworld; | 61 | World = Sceneworld; |
66 | m_log = logger; | ||
67 | 62 | ||
68 | Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); | 63 | m_log.Info("[ScriptEngine]: DotNet & LSL ScriptEngine initializing"); |
69 | 64 | ||
70 | //m_logger.Status("ScriptEngine", "InitializeEngine"); | 65 | //m_log.Info("[ScriptEngine]: InitializeEngine"); |
71 | 66 | ||
72 | // Create all objects we'll be using | 67 | // Create all objects we'll be using |
73 | m_EventQueueManager = new EventQueueManager(this); | 68 | m_EventQueueManager = new EventQueueManager(this); |
@@ -90,7 +85,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
90 | //public void StartScript(string ScriptID, IScriptHost ObjectID) | 85 | //public void StartScript(string ScriptID, IScriptHost ObjectID) |
91 | //{ | 86 | //{ |
92 | // this.myEventManager.TEMP_OBJECT_ID = ObjectID; | 87 | // this.myEventManager.TEMP_OBJECT_ID = ObjectID; |
93 | // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); | 88 | // m_log.Info("[ScriptEngine]: DEBUG FUNCTION: StartScript: " + ScriptID); |
94 | // myScriptManager.StartScript(ScriptID, ObjectID); | 89 | // myScriptManager.StartScript(ScriptID, ObjectID); |
95 | //} | 90 | //} |
96 | 91 | ||
@@ -98,7 +93,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
98 | 93 | ||
99 | public void Initialise(Scene scene, IConfigSource config) | 94 | public void Initialise(Scene scene, IConfigSource config) |
100 | { | 95 | { |
101 | InitializeEngine(scene, MainLog.Instance); | 96 | InitializeEngine(scene); |
102 | } | 97 | } |
103 | 98 | ||
104 | public void PostInitialise() | 99 | public void PostInitialise() |
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs index f482834..2846399 100644 --- a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -48,6 +48,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
48 | [Serializable] | 48 | [Serializable] |
49 | public class ScriptManager | 49 | public class ScriptManager |
50 | { | 50 | { |
51 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
52 | |||
51 | #region Declares | 53 | #region Declares |
52 | 54 | ||
53 | private Thread scriptLoadUnloadThread; | 55 | private Thread scriptLoadUnloadThread; |
@@ -312,7 +314,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
312 | } | 314 | } |
313 | catch (Exception e) | 315 | catch (Exception e) |
314 | { | 316 | { |
315 | //m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString()); | 317 | //m_scriptEngine.m_log.Error("[ScriptEngine]: Error compiling script: " + e.ToString()); |
316 | try | 318 | try |
317 | { | 319 | { |
318 | // DISPLAY ERROR INWORLD | 320 | // DISPLAY ERROR INWORLD |
@@ -323,7 +325,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
323 | } | 325 | } |
324 | catch (Exception e2) | 326 | catch (Exception e2) |
325 | { | 327 | { |
326 | m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString()); | 328 | m_scriptEngine.m_log.Error("[ScriptEngine]: Error displaying error in-world: " + e2.ToString()); |
327 | } | 329 | } |
328 | } | 330 | } |
329 | } | 331 | } |
@@ -384,7 +386,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine | |||
384 | internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) | 386 | internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) |
385 | { | 387 | { |
386 | // Execute a function in the script | 388 | // Execute a function in the script |
387 | //m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); | 389 | //m_scriptEngine.m_log.Info("[ScriptEngine]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); |
388 | LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID); | 390 | LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID); |
389 | if (Script == null) | 391 | if (Script == null) |
390 | return; | 392 | return; |
diff --git a/OpenSim/Grid/ScriptServer/Application.cs b/OpenSim/Grid/ScriptServer/Application.cs index 5857101..26bd426 100644 --- a/OpenSim/Grid/ScriptServer/Application.cs +++ b/OpenSim/Grid/ScriptServer/Application.cs | |||
@@ -37,6 +37,8 @@ namespace OpenSim.Grid.ScriptServer | |||
37 | 37 | ||
38 | private static void Main(string[] args) | 38 | private static void Main(string[] args) |
39 | { | 39 | { |
40 | log4net.Config.XmlConfigurator.Configure(); | ||
41 | |||
40 | AppDomain.CurrentDomain.UnhandledException += | 42 | AppDomain.CurrentDomain.UnhandledException += |
41 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); | 43 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); |
42 | 44 | ||
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs index 819a037..595acea 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs | |||
@@ -33,14 +33,12 @@ namespace OpenSim.Grid.ScriptServer | |||
33 | // Maintains connection and communication to a region | 33 | // Maintains connection and communication to a region |
34 | public class RegionConnectionManager : RegionBase | 34 | public class RegionConnectionManager : RegionBase |
35 | { | 35 | { |
36 | private LogBase m_log; | ||
37 | private ScriptServerMain m_ScriptServerMain; | 36 | private ScriptServerMain m_ScriptServerMain; |
38 | private object m_Connection; | 37 | private object m_Connection; |
39 | 38 | ||
40 | public RegionConnectionManager(ScriptServerMain scm, LogBase logger, object Connection) | 39 | public RegionConnectionManager(ScriptServerMain scm, object Connection) |
41 | { | 40 | { |
42 | m_ScriptServerMain = scm; | 41 | m_ScriptServerMain = scm; |
43 | m_log = logger; | ||
44 | m_Connection = Connection; | 42 | m_Connection = Connection; |
45 | } | 43 | } |
46 | 44 | ||
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs index 7d29129..524b8c4 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs | |||
@@ -38,13 +38,11 @@ namespace OpenSim.Grid.ScriptServer | |||
38 | 38 | ||
39 | private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>(); | 39 | private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>(); |
40 | 40 | ||
41 | private LogBase m_log; | ||
42 | private ScriptServerMain m_ScriptServerMain; | 41 | private ScriptServerMain m_ScriptServerMain; |
43 | 42 | ||
44 | public RegionCommManager(ScriptServerMain scm, LogBase logger) | 43 | public RegionCommManager(ScriptServerMain scm) |
45 | { | 44 | { |
46 | m_ScriptServerMain = scm; | 45 | m_ScriptServerMain = scm; |
47 | m_log = logger; | ||
48 | } | 46 | } |
49 | 47 | ||
50 | ~RegionCommManager() | 48 | ~RegionCommManager() |
@@ -96,9 +94,8 @@ namespace OpenSim.Grid.ScriptServer | |||
96 | // ~ ask scriptengines if they will accept script? | 94 | // ~ ask scriptengines if they will accept script? |
97 | // - Add script to shared communication channel towards that region | 95 | // - Add script to shared communication channel towards that region |
98 | 96 | ||
99 | |||
100 | // TODO: FAKING A CONNECTION | 97 | // TODO: FAKING A CONNECTION |
101 | Regions.Add(new RegionConnectionManager(m_ScriptServerMain, m_log, null)); | 98 | Regions.Add(new RegionConnectionManager(m_ScriptServerMain, null)); |
102 | } | 99 | } |
103 | } | 100 | } |
104 | } \ No newline at end of file | 101 | } \ No newline at end of file |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs index c9c0fb0..4bb74f5 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs | |||
@@ -35,13 +35,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
35 | { | 35 | { |
36 | internal class ScriptEngineLoader | 36 | internal class ScriptEngineLoader |
37 | { | 37 | { |
38 | private LogBase m_log; | 38 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
39 | |||
40 | |||
41 | public ScriptEngineLoader(LogBase logger) | ||
42 | { | ||
43 | m_log = logger; | ||
44 | } | ||
45 | 39 | ||
46 | public ScriptServerInterfaces.ScriptEngine LoadScriptEngine(string EngineName) | 40 | public ScriptServerInterfaces.ScriptEngine LoadScriptEngine(string EngineName) |
47 | { | 41 | { |
@@ -55,7 +49,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
55 | } | 49 | } |
56 | catch (Exception e) | 50 | catch (Exception e) |
57 | { | 51 | { |
58 | m_log.Error("ScriptEngine", | 52 | m_log.Error("[ScriptEngine]: " + |
59 | "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + | 53 | "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + |
60 | e.StackTrace.ToString()); | 54 | e.StackTrace.ToString()); |
61 | } | 55 | } |
@@ -87,7 +81,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
87 | //} | 81 | //} |
88 | //catch (Exception e) | 82 | //catch (Exception e) |
89 | //{ | 83 | //{ |
90 | // m_log.Error("ScriptEngine", "Error loading assembly \String.Empty + FileName + "\": " + e.ToString()); | 84 | // m_log.Error("[ScriptEngine]: Error loading assembly \String.Empty + FileName + "\": " + e.ToString()); |
91 | //} | 85 | //} |
92 | 86 | ||
93 | 87 | ||
@@ -104,7 +98,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
104 | //} | 98 | //} |
105 | //catch (Exception e) | 99 | //catch (Exception e) |
106 | //{ | 100 | //{ |
107 | // m_log.Error("ScriptEngine", "Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); | 101 | // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); |
108 | //} | 102 | //} |
109 | 103 | ||
110 | ScriptServerInterfaces.ScriptEngine ret; | 104 | ScriptServerInterfaces.ScriptEngine ret; |
@@ -114,7 +108,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
114 | //} | 108 | //} |
115 | //catch (Exception e) | 109 | //catch (Exception e) |
116 | //{ | 110 | //{ |
117 | // m_log.Error("ScriptEngine", "Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); | 111 | // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); |
118 | //} | 112 | //} |
119 | 113 | ||
120 | return ret; | 114 | return ret; |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs index 3bfca87..7976cb5 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs | |||
@@ -34,17 +34,15 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
34 | { | 34 | { |
35 | internal class ScriptEngineManager | 35 | internal class ScriptEngineManager |
36 | { | 36 | { |
37 | private LogBase m_log; | ||
38 | private ScriptEngineLoader ScriptEngineLoader; | 37 | private ScriptEngineLoader ScriptEngineLoader; |
39 | private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>(); | 38 | private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>(); |
40 | private ScriptServerMain m_ScriptServerMain; | 39 | private ScriptServerMain m_ScriptServerMain; |
41 | 40 | ||
42 | // Initialize | 41 | // Initialize |
43 | public ScriptEngineManager(ScriptServerMain scm, LogBase logger) | 42 | public ScriptEngineManager(ScriptServerMain scm) |
44 | { | 43 | { |
45 | m_ScriptServerMain = scm; | 44 | m_ScriptServerMain = scm; |
46 | m_log = logger; | 45 | ScriptEngineLoader = new ScriptEngineLoader(); |
47 | ScriptEngineLoader = new ScriptEngineLoader(m_log); | ||
48 | } | 46 | } |
49 | 47 | ||
50 | ~ScriptEngineManager() | 48 | ~ScriptEngineManager() |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 421467d..e2c83f1 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs | |||
@@ -40,11 +40,12 @@ namespace OpenSim.Grid.ScriptServer | |||
40 | { | 40 | { |
41 | public class ScriptServerMain : BaseOpenSimServer, conscmd_callback | 41 | public class ScriptServerMain : BaseOpenSimServer, conscmd_callback |
42 | { | 42 | { |
43 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | |||
43 | // | 45 | // |
44 | // Root object. Creates objects used. | 46 | // Root object. Creates objects used. |
45 | // | 47 | // |
46 | private int listenPort = 8010; | 48 | private int listenPort = 8010; |
47 | private readonly string m_logFilename = ("scriptserver.log"); | ||
48 | 49 | ||
49 | // TEMP | 50 | // TEMP |
50 | public static ScriptServerInterfaces.ScriptEngine Engine; | 51 | public static ScriptServerInterfaces.ScriptEngine Engine; |
@@ -59,16 +60,15 @@ namespace OpenSim.Grid.ScriptServer | |||
59 | 60 | ||
60 | public ScriptServerMain() | 61 | public ScriptServerMain() |
61 | { | 62 | { |
62 | m_log = CreateLog(); | 63 | m_console = CreateConsole(); |
63 | |||
64 | 64 | ||
65 | // Set up script engine mananger | 65 | // Set up script engine mananger |
66 | ScriptEngines = new ScriptEngineManager(this, m_log); | 66 | ScriptEngines = new ScriptEngineManager(this); |
67 | 67 | ||
68 | // Load DotNetEngine | 68 | // Load DotNetEngine |
69 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); | 69 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); |
70 | IConfigSource config = null; | 70 | IConfigSource config = null; |
71 | Engine.InitializeEngine(null, null, m_log, false, Engine.GetScriptManager()); | 71 | Engine.InitializeEngine(null, null, false, Engine.GetScriptManager()); |
72 | 72 | ||
73 | 73 | ||
74 | // Set up server | 74 | // Set up server |
@@ -83,12 +83,12 @@ namespace OpenSim.Grid.ScriptServer | |||
83 | 83 | ||
84 | private void RPC_ReceiveCommand(int ID, string Command, object[] p) | 84 | private void RPC_ReceiveCommand(int ID, string Command, object[] p) |
85 | { | 85 | { |
86 | m_log.Notice("SERVER", "Received command: '" + Command + "'"); | 86 | m_log.Info("[SERVER]: Received command: '" + Command + "'"); |
87 | if (p != null) | 87 | if (p != null) |
88 | { | 88 | { |
89 | for (int i = 0; i < p.Length; i++) | 89 | for (int i = 0; i < p.Length; i++) |
90 | { | 90 | { |
91 | m_log.Notice("SERVER", "Param " + i + ": " + p[i].ToString()); | 91 | m_log.Info("[SERVER]: Param " + i + ": " + p[i].ToString()); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
@@ -102,14 +102,9 @@ namespace OpenSim.Grid.ScriptServer | |||
102 | { | 102 | { |
103 | } | 103 | } |
104 | 104 | ||
105 | protected LogBase CreateLog() | 105 | protected ConsoleBase CreateConsole() |
106 | { | 106 | { |
107 | if (!Directory.Exists(Util.logDir())) | 107 | return new ConsoleBase("ScriptServer", this); |
108 | { | ||
109 | Directory.CreateDirectory(Util.logDir()); | ||
110 | } | ||
111 | |||
112 | return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "ScriptServer", this, true); | ||
113 | } | 108 | } |
114 | } | 109 | } |
115 | } | 110 | } |
diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs index d2736c6..865dfea 100644 --- a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs | |||
@@ -35,9 +35,11 @@ namespace OpenUser.Config.UserConfigDb4o | |||
35 | { | 35 | { |
36 | public class Db4oConfigPlugin: IUserConfig | 36 | public class Db4oConfigPlugin: IUserConfig |
37 | { | 37 | { |
38 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
39 | |||
38 | public UserConfig GetConfigObject() | 40 | public UserConfig GetConfigObject() |
39 | { | 41 | { |
40 | MainLog.Instance.Verbose("DBUSERCONFIG", "Loading Db40Config dll"); | 42 | m_log.Info("[DBUSERCONFIG]: Loading Db40Config dll"); |
41 | return ( new DbUserConfig()); | 43 | return ( new DbUserConfig()); |
42 | } | 44 | } |
43 | } | 45 | } |
@@ -48,13 +50,13 @@ namespace OpenUser.Config.UserConfigDb4o | |||
48 | 50 | ||
49 | public void LoadDefaults() | 51 | public void LoadDefaults() |
50 | { | 52 | { |
51 | MainLog.Instance.Notice("DbUserConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); | 53 | m_log.Info("DbUserConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); |
52 | 54 | ||
53 | this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); | 55 | this.DefaultStartupMsg = m_log.CmdPrompt("Default startup message", "Welcome to OGS"); |
54 | 56 | ||
55 | this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/"); | 57 | this.GridServerURL = m_log.CmdPrompt("Grid server URL","http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/"); |
56 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null"); | 58 | this.GridSendKey = m_log.CmdPrompt("Key to send to grid server","null"); |
57 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); | 59 | this.GridRecvKey = m_log.CmdPrompt("Key to expect from grid server","null"); |
58 | } | 60 | } |
59 | 61 | ||
60 | public override void InitConfig() | 62 | public override void InitConfig() |
@@ -65,7 +67,7 @@ namespace OpenUser.Config.UserConfigDb4o | |||
65 | IObjectSet result = db.Get(typeof(DbUserConfig)); | 67 | IObjectSet result = db.Get(typeof(DbUserConfig)); |
66 | if(result.Count==1) | 68 | if(result.Count==1) |
67 | { | 69 | { |
68 | MainLog.Instance.Verbose("DBUSERCONFIG", "DbUserConfig.cs:InitConfig() - Found a UserConfig object in the local database, loading"); | 70 | m_log.Info("[DBUSERCONFIG]: DbUserConfig.cs:InitConfig() - Found a UserConfig object in the local database, loading"); |
69 | foreach (DbUserConfig cfg in result) | 71 | foreach (DbUserConfig cfg in result) |
70 | { | 72 | { |
71 | this.GridServerURL=cfg.GridServerURL; | 73 | this.GridServerURL=cfg.GridServerURL; |
@@ -76,24 +78,24 @@ namespace OpenUser.Config.UserConfigDb4o | |||
76 | } | 78 | } |
77 | else | 79 | else |
78 | { | 80 | { |
79 | MainLog.Instance.Verbose("DBUSERCONFIG", "DbUserConfig.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); | 81 | m_log.Info("[DBUSERCONFIG]: DbUserConfig.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); |
80 | LoadDefaults(); | 82 | LoadDefaults(); |
81 | MainLog.Instance.Verbose("DBUSERCONFIG", "Writing out default settings to local database"); | 83 | m_log.Info("[DBUSERCONFIG]: Writing out default settings to local database"); |
82 | db.Set(this); | 84 | db.Set(this); |
83 | db.Close(); | 85 | db.Close(); |
84 | } | 86 | } |
85 | } | 87 | } |
86 | catch(Exception e) | 88 | catch(Exception e) |
87 | { | 89 | { |
88 | MainLog.Instance.Warn("DbUserConfig.cs:InitConfig() - Exception occured"); | 90 | m_log.Warn("DbUserConfig.cs:InitConfig() - Exception occured"); |
89 | MainLog.Instance.Warn(e.ToString()); | 91 | m_log.Warn(e.ToString()); |
90 | } | 92 | } |
91 | 93 | ||
92 | MainLog.Instance.Verbose("DBUSERCONFIG", "User settings loaded:"); | 94 | m_log.Info("[DBUSERCONFIG]: User settings loaded:"); |
93 | MainLog.Instance.Verbose("DBUSERCONFIG", "Default startup message: " + this.DefaultStartupMsg); | 95 | m_log.Info("[DBUSERCONFIG]: Default startup message: " + this.DefaultStartupMsg); |
94 | MainLog.Instance.Verbose("DBUSERCONFIG", "Grid server URL: " + this.GridServerURL); | 96 | m_log.Info("[DBUSERCONFIG]: Grid server URL: " + this.GridServerURL); |
95 | MainLog.Instance.Verbose("DBUSERCONFIG", "Key to send to grid: " + this.GridSendKey); | 97 | m_log.Info("[DBUSERCONFIG]: Key to send to grid: " + this.GridSendKey); |
96 | MainLog.Instance.Verbose("DBUSERCONFIG", "Key to expect from grid: " + this.GridRecvKey); | 98 | m_log.Info("[DBUSERCONFIG]: Key to expect from grid: " + this.GridRecvKey); |
97 | } | 99 | } |
98 | 100 | ||
99 | public void Shutdown() | 101 | public void Shutdown() |
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 32cefc1..8b9fd62 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -42,6 +42,8 @@ namespace OpenSim.Grid.UserServer | |||
42 | /// </summary> | 42 | /// </summary> |
43 | public class OpenUser_Main : BaseOpenSimServer, conscmd_callback | 43 | public class OpenUser_Main : BaseOpenSimServer, conscmd_callback |
44 | { | 44 | { |
45 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
45 | private UserConfig Cfg; | 47 | private UserConfig Cfg; |
46 | 48 | ||
47 | public UserManager m_userManager; | 49 | public UserManager m_userManager; |
@@ -53,7 +55,9 @@ namespace OpenSim.Grid.UserServer | |||
53 | [STAThread] | 55 | [STAThread] |
54 | public static void Main(string[] args) | 56 | public static void Main(string[] args) |
55 | { | 57 | { |
56 | Console.WriteLine("Launching UserServer..."); | 58 | log4net.Config.XmlConfigurator.Configure(); |
59 | |||
60 | m_log.Info("Launching UserServer..."); | ||
57 | 61 | ||
58 | OpenUser_Main userserver = new OpenUser_Main(); | 62 | OpenUser_Main userserver = new OpenUser_Main(); |
59 | 63 | ||
@@ -63,22 +67,17 @@ namespace OpenSim.Grid.UserServer | |||
63 | 67 | ||
64 | private OpenUser_Main() | 68 | private OpenUser_Main() |
65 | { | 69 | { |
66 | if (!Directory.Exists(Util.logDir())) | 70 | m_console = new ConsoleBase("OpenUser", this); |
67 | { | 71 | MainConsole.Instance = m_console; |
68 | Directory.CreateDirectory(Util.logDir()); | ||
69 | } | ||
70 | m_log = | ||
71 | new LogBase((Path.Combine(Util.logDir(), "opengrid-userserver-console.log")), "OpenUser", this, true); | ||
72 | MainLog.Instance = m_log; | ||
73 | } | 72 | } |
74 | 73 | ||
75 | private void Work() | 74 | private void Work() |
76 | { | 75 | { |
77 | m_log.Notice("Enter help for a list of commands\n"); | 76 | m_console.Notice("Enter help for a list of commands\n"); |
78 | 77 | ||
79 | while (true) | 78 | while (true) |
80 | { | 79 | { |
81 | m_log.MainLogPrompt(); | 80 | m_console.Prompt(); |
82 | } | 81 | } |
83 | } | 82 | } |
84 | 83 | ||
@@ -88,7 +87,7 @@ namespace OpenSim.Grid.UserServer | |||
88 | 87 | ||
89 | StatsManager.StartCollectingUserStats(); | 88 | StatsManager.StartCollectingUserStats(); |
90 | 89 | ||
91 | MainLog.Instance.Verbose("REGION", "Establishing data connection"); | 90 | m_log.Info("[REGION]: Establishing data connection"); |
92 | m_userManager = new UserManager(); | 91 | m_userManager = new UserManager(); |
93 | m_userManager._config = Cfg; | 92 | m_userManager._config = Cfg; |
94 | m_userManager.AddPlugin(Cfg.DatabaseProvider); | 93 | m_userManager.AddPlugin(Cfg.DatabaseProvider); |
@@ -96,11 +95,11 @@ namespace OpenSim.Grid.UserServer | |||
96 | m_loginService = new UserLoginService( | 95 | m_loginService = new UserLoginService( |
97 | m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); | 96 | m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); |
98 | 97 | ||
99 | m_messagesService = new MessageServersConnector(MainLog.Instance); | 98 | m_messagesService = new MessageServersConnector(); |
100 | 99 | ||
101 | m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; | 100 | m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; |
102 | 101 | ||
103 | MainLog.Instance.Verbose("REGION", "Starting HTTP process"); | 102 | m_log.Info("[REGION]: Starting HTTP process"); |
104 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); | 103 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); |
105 | 104 | ||
106 | httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); | 105 | httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); |
@@ -128,10 +127,9 @@ namespace OpenSim.Grid.UserServer | |||
128 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); | 127 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); |
129 | 128 | ||
130 | httpServer.Start(); | 129 | httpServer.Start(); |
131 | m_log.Status("SERVER", "Userserver 0.4 - Startup complete"); | 130 | m_log.Info("[SERVER]: Userserver 0.4 - Startup complete"); |
132 | } | 131 | } |
133 | 132 | ||
134 | |||
135 | public void do_create(string what) | 133 | public void do_create(string what) |
136 | { | 134 | { |
137 | switch (what) | 135 | switch (what) |
@@ -143,11 +141,11 @@ namespace OpenSim.Grid.UserServer | |||
143 | uint regX = 1000; | 141 | uint regX = 1000; |
144 | uint regY = 1000; | 142 | uint regY = 1000; |
145 | 143 | ||
146 | tempfirstname = m_log.CmdPrompt("First name"); | 144 | tempfirstname = m_console.CmdPrompt("First name"); |
147 | templastname = m_log.CmdPrompt("Last name"); | 145 | templastname = m_console.CmdPrompt("Last name"); |
148 | tempMD5Passwd = m_log.PasswdPrompt("Password"); | 146 | tempMD5Passwd = m_console.PasswdPrompt("Password"); |
149 | regX = Convert.ToUInt32(m_log.CmdPrompt("Start Region X")); | 147 | regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X")); |
150 | regY = Convert.ToUInt32(m_log.CmdPrompt("Start Region Y")); | 148 | regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y")); |
151 | 149 | ||
152 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); | 150 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); |
153 | 151 | ||
@@ -158,7 +156,7 @@ namespace OpenSim.Grid.UserServer | |||
158 | m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 156 | m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
159 | } catch (Exception ex) | 157 | } catch (Exception ex) |
160 | { | 158 | { |
161 | m_log.Error("SERVER", "Error creating user: {0}", ex.ToString()); | 159 | m_log.Error(String.Format("[SERVER]: Error creating user: {0}", ex.ToString())); |
162 | } | 160 | } |
163 | 161 | ||
164 | try | 162 | try |
@@ -168,7 +166,7 @@ namespace OpenSim.Grid.UserServer | |||
168 | } | 166 | } |
169 | catch (Exception ex) | 167 | catch (Exception ex) |
170 | { | 168 | { |
171 | m_log.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); | 169 | m_log.Error(String.Format("[SERVER]: Error creating inventory for user: {0}", ex.ToString())); |
172 | } | 170 | } |
173 | m_lastCreatedUser = userID; | 171 | m_lastCreatedUser = userID; |
174 | break; | 172 | break; |
@@ -182,9 +180,9 @@ namespace OpenSim.Grid.UserServer | |||
182 | switch (cmd) | 180 | switch (cmd) |
183 | { | 181 | { |
184 | case "help": | 182 | case "help": |
185 | m_log.Notice("create user - create a new user"); | 183 | m_console.Notice("create user - create a new user"); |
186 | m_log.Notice("stats - statistical information for this server"); | 184 | m_console.Notice("stats - statistical information for this server"); |
187 | m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | 185 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); |
188 | break; | 186 | break; |
189 | 187 | ||
190 | case "create": | 188 | case "create": |
@@ -193,12 +191,12 @@ namespace OpenSim.Grid.UserServer | |||
193 | 191 | ||
194 | case "shutdown": | 192 | case "shutdown": |
195 | m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; | 193 | m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; |
196 | m_log.Close(); | 194 | m_console.Close(); |
197 | Environment.Exit(0); | 195 | Environment.Exit(0); |
198 | break; | 196 | break; |
199 | 197 | ||
200 | case "stats": | 198 | case "stats": |
201 | MainLog.Instance.Notice("STATS", Environment.NewLine + StatsManager.UserStats.Report()); | 199 | m_console.Notice(StatsManager.UserStats.Report()); |
202 | break; | 200 | break; |
203 | 201 | ||
204 | case "test-inventory": | 202 | case "test-inventory": |
@@ -218,8 +216,9 @@ namespace OpenSim.Grid.UserServer | |||
218 | 216 | ||
219 | public void TestResponse(List<InventoryFolderBase> resp) | 217 | public void TestResponse(List<InventoryFolderBase> resp) |
220 | { | 218 | { |
221 | Console.WriteLine("response got"); | 219 | m_console.Notice("response got"); |
222 | } | 220 | } |
221 | |||
223 | public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position) | 222 | public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position) |
224 | { | 223 | { |
225 | m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, Position); | 224 | m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, Position); |
diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs index 93d5925..251644b 100644 --- a/OpenSim/Grid/UserServer/MessageServersConnector.cs +++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs | |||
@@ -39,15 +39,14 @@ using OpenSim.Framework.Servers; | |||
39 | 39 | ||
40 | namespace OpenSim.Grid.UserServer | 40 | namespace OpenSim.Grid.UserServer |
41 | { | 41 | { |
42 | |||
43 | public class MessageServersConnector | 42 | public class MessageServersConnector |
44 | { | 43 | { |
45 | private LogBase m_log; | 44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
45 | |||
46 | public Dictionary<string, MessageServerInfo> MessageServers; | 46 | public Dictionary<string, MessageServerInfo> MessageServers; |
47 | 47 | ||
48 | public MessageServersConnector(LogBase log) | 48 | public MessageServersConnector() |
49 | { | 49 | { |
50 | m_log=log; | ||
51 | MessageServers = new Dictionary<string, MessageServerInfo>(); | 50 | MessageServers = new Dictionary<string, MessageServerInfo>(); |
52 | } | 51 | } |
53 | 52 | ||
@@ -65,7 +64,7 @@ namespace OpenSim.Grid.UserServer | |||
65 | { | 64 | { |
66 | if (!MessageServers.ContainsKey(URI)) | 65 | if (!MessageServers.ContainsKey(URI)) |
67 | { | 66 | { |
68 | m_log.Warn("MSGSERVER", "Got addResponsibleRegion Request for a MessageServer that isn't registered"); | 67 | m_log.Warn("[MSGSERVER]: Got addResponsibleRegion Request for a MessageServer that isn't registered"); |
69 | } | 68 | } |
70 | else | 69 | else |
71 | { | 70 | { |
@@ -78,7 +77,7 @@ namespace OpenSim.Grid.UserServer | |||
78 | { | 77 | { |
79 | if (!MessageServers.ContainsKey(URI)) | 78 | if (!MessageServers.ContainsKey(URI)) |
80 | { | 79 | { |
81 | m_log.Warn("MSGSERVER", "Got RemoveResponsibleRegion Request for a MessageServer that isn't registered"); | 80 | m_log.Warn("[MSGSERVER]: Got RemoveResponsibleRegion Request for a MessageServer that isn't registered"); |
82 | } | 81 | } |
83 | else | 82 | else |
84 | { | 83 | { |
@@ -175,10 +174,7 @@ namespace OpenSim.Grid.UserServer | |||
175 | 174 | ||
176 | XmlRpcRequest GridReq = new XmlRpcRequest("login_to_simulator", SendParams); | 175 | XmlRpcRequest GridReq = new XmlRpcRequest("login_to_simulator", SendParams); |
177 | XmlRpcResponse GridResp = GridReq.Send(serv.URI, 6000); | 176 | XmlRpcResponse GridResp = GridReq.Send(serv.URI, 6000); |
178 | m_log.Verbose("LOGIN","Notified : " + serv.URI + " about user login"); | 177 | m_log.Info("[LOGIN]: Notified : " + serv.URI + " about user login"); |
179 | |||
180 | } | 178 | } |
181 | |||
182 | |||
183 | } | 179 | } |
184 | } | 180 | } |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 10f9468..d5cdf1c 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -46,9 +46,10 @@ namespace OpenSim.Grid.UserServer | |||
46 | { | 46 | { |
47 | public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position); | 47 | public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position); |
48 | 48 | ||
49 | |||
50 | public class UserLoginService : LoginService | 49 | public class UserLoginService : LoginService |
51 | { | 50 | { |
51 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
52 | |||
52 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; | 53 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; |
53 | 54 | ||
54 | public UserConfig m_config; | 55 | public UserConfig m_config; |
@@ -70,7 +71,7 @@ namespace OpenSim.Grid.UserServer | |||
70 | { | 71 | { |
71 | bool tryDefault = false; | 72 | bool tryDefault = false; |
72 | //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one. | 73 | //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one. |
73 | //CFK: MainLog.Instance.Verbose("LOGIN", "Load information from the gridserver"); | 74 | //CFK: m_log.Info("[LOGIN]: Load information from the gridserver"); |
74 | RegionProfileData SimInfo = new RegionProfileData(); | 75 | RegionProfileData SimInfo = new RegionProfileData(); |
75 | try | 76 | try |
76 | { | 77 | { |
@@ -80,7 +81,7 @@ namespace OpenSim.Grid.UserServer | |||
80 | 81 | ||
81 | // Customise the response | 82 | // Customise the response |
82 | //CFK: This is redundant and the next message should always appear. | 83 | //CFK: This is redundant and the next message should always appear. |
83 | //CFK: MainLog.Instance.Verbose("LOGIN", "Home Location"); | 84 | //CFK: m_log.Info("[LOGIN]: Home Location"); |
84 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + | 85 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + |
85 | (SimInfo.regionLocY*256).ToString() + "], " + | 86 | (SimInfo.regionLocY*256).ToString() + "], " + |
86 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + | 87 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + |
@@ -91,7 +92,7 @@ namespace OpenSim.Grid.UserServer | |||
91 | // Destination | 92 | // Destination |
92 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into | 93 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into |
93 | //CFK: the next one for X & Y and comment this one. | 94 | //CFK: the next one for X & Y and comment this one. |
94 | //CFK: MainLog.Instance.Verbose("LOGIN", "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + | 95 | //CFK: m_log.Info("[LOGIN]: CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + |
95 | //CFK: "; Region Y: " + SimInfo.regionLocY); | 96 | //CFK: "; Region Y: " + SimInfo.regionLocY); |
96 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); | 97 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); |
97 | response.SimPort = (uint) SimInfo.serverPort; | 98 | response.SimPort = (uint) SimInfo.serverPort; |
@@ -105,7 +106,7 @@ namespace OpenSim.Grid.UserServer | |||
105 | // Notify the target of an incoming user | 106 | // Notify the target of an incoming user |
106 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into | 107 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into |
107 | //CFK: the next one for X & Y and comment this one. | 108 | //CFK: the next one for X & Y and comment this one. |
108 | //CFK: MainLog.Instance.Verbose("LOGIN", SimInfo.regionName + " (" + SimInfo.serverURI + ") " + | 109 | //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " + |
109 | //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); | 110 | //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); |
110 | 111 | ||
111 | // Prepare notification | 112 | // Prepare notification |
@@ -128,7 +129,7 @@ namespace OpenSim.Grid.UserServer | |||
128 | theUser.currentAgent.currentRegion = SimInfo.UUID; | 129 | theUser.currentAgent.currentRegion = SimInfo.UUID; |
129 | theUser.currentAgent.currentHandle = SimInfo.regionHandle; | 130 | theUser.currentAgent.currentHandle = SimInfo.regionHandle; |
130 | 131 | ||
131 | MainLog.Instance.Verbose("LOGIN", SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + | 132 | m_log.Info("[LOGIN]: " + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + |
132 | SimInfo.regionLocX + "," + SimInfo.regionLocY); | 133 | SimInfo.regionLocX + "," + SimInfo.regionLocY); |
133 | 134 | ||
134 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); | 135 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); |
@@ -145,9 +146,8 @@ namespace OpenSim.Grid.UserServer | |||
145 | 146 | ||
146 | ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256); | 147 | ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256); |
147 | 148 | ||
148 | MainLog.Instance.Warn( | 149 | m_log.Warn( |
149 | "LOGIN", | 150 | "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString()); |
150 | "Home region not available: sending to default " + defaultHandle.ToString()); | ||
151 | 151 | ||
152 | SimInfo = new RegionProfileData(); | 152 | SimInfo = new RegionProfileData(); |
153 | try | 153 | try |
@@ -157,7 +157,7 @@ namespace OpenSim.Grid.UserServer | |||
157 | m_config.GridSendKey, m_config.GridRecvKey); | 157 | m_config.GridSendKey, m_config.GridRecvKey); |
158 | 158 | ||
159 | // Customise the response | 159 | // Customise the response |
160 | MainLog.Instance.Verbose("LOGIN", "Home Location"); | 160 | m_log.Info("[LOGIN]: Home Location"); |
161 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + | 161 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + |
162 | (SimInfo.regionLocY*256).ToString() + "], " + | 162 | (SimInfo.regionLocY*256).ToString() + "], " + |
163 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + | 163 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + |
@@ -166,9 +166,9 @@ namespace OpenSim.Grid.UserServer | |||
166 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; | 166 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; |
167 | 167 | ||
168 | // Destination | 168 | // Destination |
169 | MainLog.Instance.Verbose("LOGIN", | 169 | m_log.Info("[LOGIN]: " + |
170 | "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + | 170 | "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + |
171 | SimInfo.regionLocY); | 171 | SimInfo.regionLocY); |
172 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); | 172 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); |
173 | response.SimPort = (uint) SimInfo.serverPort; | 173 | response.SimPort = (uint) SimInfo.serverPort; |
174 | response.RegionX = SimInfo.regionLocX; | 174 | response.RegionX = SimInfo.regionLocX; |
@@ -179,7 +179,7 @@ namespace OpenSim.Grid.UserServer | |||
179 | response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; | 179 | response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; |
180 | 180 | ||
181 | // Notify the target of an incoming user | 181 | // Notify the target of an incoming user |
182 | MainLog.Instance.Verbose("LOGIN", "Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); | 182 | m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); |
183 | 183 | ||
184 | // Update agent with target sim | 184 | // Update agent with target sim |
185 | theUser.currentAgent.currentRegion = SimInfo.UUID; | 185 | theUser.currentAgent.currentRegion = SimInfo.UUID; |
@@ -201,7 +201,7 @@ namespace OpenSim.Grid.UserServer | |||
201 | ArrayList SendParams = new ArrayList(); | 201 | ArrayList SendParams = new ArrayList(); |
202 | SendParams.Add(SimParams); | 202 | SendParams.Add(SimParams); |
203 | 203 | ||
204 | MainLog.Instance.Verbose("LOGIN", "Informing region at " + SimInfo.httpServerURI); | 204 | m_log.Info("[LOGIN]: Informing region at " + SimInfo.httpServerURI); |
205 | // Send | 205 | // Send |
206 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); | 206 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); |
207 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); | 207 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); |
@@ -213,8 +213,8 @@ namespace OpenSim.Grid.UserServer | |||
213 | 213 | ||
214 | catch (Exception e) | 214 | catch (Exception e) |
215 | { | 215 | { |
216 | MainLog.Instance.Warn("LOGIN", "Default region also not available"); | 216 | m_log.Warn("[LOGIN]: Default region also not available"); |
217 | MainLog.Instance.Warn("LOGIN", e.ToString()); | 217 | m_log.Warn("[LOGIN]: " + e.ToString()); |
218 | } | 218 | } |
219 | } | 219 | } |
220 | } | 220 | } |
@@ -230,8 +230,8 @@ namespace OpenSim.Grid.UserServer | |||
230 | // which does. | 230 | // which does. |
231 | if (null == folders | folders.Count == 0) | 231 | if (null == folders | folders.Count == 0) |
232 | { | 232 | { |
233 | MainLog.Instance.Warn( | 233 | m_log.Warn( |
234 | "LOGIN", | 234 | "[LOGIN]: " + |
235 | "A root inventory folder for user ID " + userID + " was not found. A new set" | 235 | "A root inventory folder for user ID " + userID + " was not found. A new set" |
236 | + " of empty inventory folders is being created."); | 236 | + " of empty inventory folders is being created."); |
237 | 237 | ||
@@ -269,8 +269,8 @@ namespace OpenSim.Grid.UserServer | |||
269 | } | 269 | } |
270 | else | 270 | else |
271 | { | 271 | { |
272 | MainLog.Instance.Warn("LOGIN", "The root inventory folder could still not be retrieved" + | 272 | m_log.Warn("[LOGIN]: The root inventory folder could still not be retrieved" + |
273 | " for user ID " + userID); | 273 | " for user ID " + userID); |
274 | 274 | ||
275 | AgentInventory userInventory = new AgentInventory(); | 275 | AgentInventory userInventory = new AgentInventory(); |
276 | userInventory.CreateRootFolder(userID, false); | 276 | userInventory.CreateRootFolder(userID, false); |
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index c36de7f..8f2d83c 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -39,6 +39,8 @@ namespace OpenSim.Grid.UserServer | |||
39 | { | 39 | { |
40 | public class UserManager : UserManagerBase | 40 | public class UserManager : UserManagerBase |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
42 | /// <summary> | 44 | /// <summary> |
43 | /// Deletes an active agent session | 45 | /// Deletes an active agent session |
44 | /// </summary> | 46 | /// </summary> |
@@ -106,6 +108,7 @@ namespace OpenSim.Grid.UserServer | |||
106 | 108 | ||
107 | return response; | 109 | return response; |
108 | } | 110 | } |
111 | |||
109 | /// <summary> | 112 | /// <summary> |
110 | /// Converts a user profile to an XML element which can be returned | 113 | /// Converts a user profile to an XML element which can be returned |
111 | /// </summary> | 114 | /// </summary> |
@@ -202,7 +205,6 @@ namespace OpenSim.Grid.UserServer | |||
202 | responseData["returnString"] = returnString; | 205 | responseData["returnString"] = returnString; |
203 | response.Value = responseData; | 206 | response.Value = responseData; |
204 | return response; | 207 | return response; |
205 | |||
206 | } | 208 | } |
207 | 209 | ||
208 | public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) | 210 | public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) |
@@ -212,8 +214,6 @@ namespace OpenSim.Grid.UserServer | |||
212 | Hashtable responseData = new Hashtable(); | 214 | Hashtable responseData = new Hashtable(); |
213 | string returnString = "FALSE"; | 215 | string returnString = "FALSE"; |
214 | 216 | ||
215 | |||
216 | |||
217 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) | 217 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) |
218 | { | 218 | { |
219 | UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); | 219 | UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); |
@@ -233,8 +233,6 @@ namespace OpenSim.Grid.UserServer | |||
233 | 233 | ||
234 | List<FriendListItem> returndata = new List<FriendListItem>(); | 234 | List<FriendListItem> returndata = new List<FriendListItem>(); |
235 | 235 | ||
236 | |||
237 | |||
238 | if (requestData.Contains("ownerID")) | 236 | if (requestData.Contains("ownerID")) |
239 | { | 237 | { |
240 | returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"])); | 238 | returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"])); |
@@ -309,7 +307,6 @@ namespace OpenSim.Grid.UserServer | |||
309 | return CreateUnknownUserErrorResponse(); | 307 | return CreateUnknownUserErrorResponse(); |
310 | } | 308 | } |
311 | 309 | ||
312 | |||
313 | return ProfileToXmlRPCResponse(userProfile); | 310 | return ProfileToXmlRPCResponse(userProfile); |
314 | } | 311 | } |
315 | 312 | ||
@@ -318,7 +315,6 @@ namespace OpenSim.Grid.UserServer | |||
318 | XmlRpcResponse response = new XmlRpcResponse(); | 315 | XmlRpcResponse response = new XmlRpcResponse(); |
319 | Hashtable requestData = (Hashtable)request.Params[0]; | 316 | Hashtable requestData = (Hashtable)request.Params[0]; |
320 | 317 | ||
321 | |||
322 | UserProfileData userProfile; | 318 | UserProfileData userProfile; |
323 | 319 | ||
324 | if (requestData.Contains("avatar_uuid")) | 320 | if (requestData.Contains("avatar_uuid")) |
@@ -336,17 +332,15 @@ namespace OpenSim.Grid.UserServer | |||
336 | } | 332 | } |
337 | catch (FormatException) | 333 | catch (FormatException) |
338 | { | 334 | { |
339 | OpenSim.Framework.Console.MainLog.Instance.Warn("LOGOUT", "Error in Logout XMLRPC Params"); | 335 | m_log.Warn("[LOGOUT]: Error in Logout XMLRPC Params"); |
340 | return response; | 336 | return response; |
341 | } | 337 | } |
342 | |||
343 | } | 338 | } |
344 | else | 339 | else |
345 | { | 340 | { |
346 | return CreateUnknownUserErrorResponse(); | 341 | return CreateUnknownUserErrorResponse(); |
347 | } | 342 | } |
348 | 343 | ||
349 | |||
350 | return response; | 344 | return response; |
351 | } | 345 | } |
352 | 346 | ||