Converted logging to use log4net.

Changed LogBase to ConsoleBase, which handles console I/O.
This is mostly an in-place conversion, so lots of refactoring can still be done.
ThreadPoolClientBranch
Jeff Ames 2008-02-05 19:44:27 +00:00
parent 7a61bcff86
commit 6ed5283bc0
173 changed files with 2175 additions and 1950 deletions

View File

@ -40,19 +40,21 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
[Extension("/OpenSim/Startup")] [Extension("/OpenSim/Startup")]
public class LoadRegionsPlugin : IApplicationPlugin public class LoadRegionsPlugin : IApplicationPlugin
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public void Initialise(OpenSimMain openSim) public void Initialise(OpenSimMain openSim)
{ {
MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised"); m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
IRegionLoader regionLoader; IRegionLoader regionLoader;
if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
{ {
MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from filesystem"); m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
regionLoader = new RegionLoaderFileSystem(); regionLoader = new RegionLoaderFileSystem();
} }
else else
{ {
MainLog.Instance.Notice("LOADREGIONSPLUGIN", "Loading Region Info from web"); m_log.Info("[LOADREGIONSPLUGIN]: Loading Region Info from web");
regionLoader = new RegionLoaderWebServer(); regionLoader = new RegionLoaderWebServer();
} }
@ -63,7 +65,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
for (int i = 0; i < regionsToLoad.Length; i++) for (int i = 0; i < regionsToLoad.Length; i++)
{ {
MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")");
openSim.CreateRegion(regionsToLoad[i]); openSim.CreateRegion(regionsToLoad[i]);
} }
@ -73,17 +75,17 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle) public void LoadRegionFromConfig(OpenSimMain openSim, ulong regionhandle)
{ {
MainLog.Instance.Notice("LOADREGIONS", "Load Regions addin being initialised"); m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
IRegionLoader regionLoader; IRegionLoader regionLoader;
if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") if (openSim.ConfigSource.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
{ {
MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from filesystem"); m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
regionLoader = new RegionLoaderFileSystem(); regionLoader = new RegionLoaderFileSystem();
} }
else else
{ {
MainLog.Instance.Notice("LOADREGIONS", "Loading Region Info from web"); m_log.Info("[LOADREGIONS]: Loading Region Info from web");
regionLoader = new RegionLoaderWebServer(); regionLoader = new RegionLoaderWebServer();
} }
@ -93,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{ {
if (regionhandle == regionsToLoad[i].RegionHandle) if (regionhandle == regionsToLoad[i].RegionHandle)
{ {
MainLog.Instance.Debug("LOADREGIONS", "Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")"); m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + ")");
openSim.CreateRegion(regionsToLoad[i]); openSim.CreateRegion(regionsToLoad[i]);
} }
} }

View File

@ -46,6 +46,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
[Extension("/OpenSim/Startup")] [Extension("/OpenSim/Startup")]
public class RemoteAdminPlugin : IApplicationPlugin public class RemoteAdminPlugin : IApplicationPlugin
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private OpenSimMain m_app; private OpenSimMain m_app;
private BaseHttpServer m_httpd; private BaseHttpServer m_httpd;
private string requiredPassword = String.Empty; private string requiredPassword = String.Empty;
@ -56,7 +58,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{ {
if (openSim.ConfigSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) if (openSim.ConfigSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
{ {
MainLog.Instance.Verbose("RADMIN", "Remote Admin Plugin Enabled"); m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
requiredPassword = openSim.ConfigSource.Configs["RemoteAdmin"].GetString("access_password", String.Empty); requiredPassword = openSim.ConfigSource.Configs["RemoteAdmin"].GetString("access_password", String.Empty);
m_app = openSim; m_app = openSim;
@ -126,7 +128,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
else else
{ {
string message = (string) requestData["message"]; string message = (string) requestData["message"];
MainLog.Instance.Verbose("RADMIN", "Broadcasting: " + message); m_log.Info("[RADMIN]: Broadcasting: " + message);
responseData["accepted"] = "true"; responseData["accepted"] = "true";
response.Value = responseData; response.Value = responseData;
@ -153,7 +155,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{ {
string file = (string)requestData["filename"]; string file = (string)requestData["filename"];
LLUUID regionID = LLUUID.Parse((string)requestData["regionid"]); LLUUID regionID = LLUUID.Parse((string)requestData["regionid"]);
MainLog.Instance.Verbose("RADMIN", "Terrain Loading: " + file); m_log.Info("[RADMIN]: Terrain Loading: " + file);
responseData["accepted"] = "true"; responseData["accepted"] = "true";
@ -177,7 +179,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
{ {
MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request"); m_log.Info("[RADMIN]: Received Shutdown Administrator Request");
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable) request.Params[0]; Hashtable requestData = (Hashtable) request.Params[0];
Hashtable responseData = new Hashtable(); Hashtable responseData = new Hashtable();
@ -233,7 +235,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
public XmlRpcResponse XmlRpcCreateRegionMethod(XmlRpcRequest request) public XmlRpcResponse XmlRpcCreateRegionMethod(XmlRpcRequest request)
{ {
MainLog.Instance.Verbose("RADMIN", "Received Create Region Administrator Request"); m_log.Info("[RADMIN]: Received Create Region Administrator Request");
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable) request.Params[0]; Hashtable requestData = (Hashtable) request.Params[0];
Hashtable responseData = new Hashtable(); Hashtable responseData = new Hashtable();
@ -284,7 +286,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request) public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request)
{ {
MainLog.Instance.Verbose("RADMIN", "Received Create User Administrator Request"); m_log.Info("[RADMIN]: Received Create User Administrator Request");
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable) request.Params[0]; Hashtable requestData = (Hashtable) request.Params[0];
Hashtable responseData = new Hashtable(); Hashtable responseData = new Hashtable();
@ -312,14 +314,14 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
responseData["error"] = "Error creating user"; responseData["error"] = "Error creating user";
responseData["avatar_uuid"] = LLUUID.Zero; responseData["avatar_uuid"] = LLUUID.Zero;
response.Value = responseData; response.Value = responseData;
MainLog.Instance.Error("RADMIN", "Error creating user (" + tempfirstname + " " + templastname + ") :"); m_log.Error("[RADMIN]: Error creating user (" + tempfirstname + " " + templastname + ") :");
} }
else else
{ {
responseData["created"] = "true"; responseData["created"] = "true";
responseData["avatar_uuid"] = tempuserID; responseData["avatar_uuid"] = tempuserID;
response.Value = responseData; response.Value = responseData;
MainLog.Instance.Verbose("RADMIN", "User " + tempfirstname + " " + templastname + " created. Userid " + tempuserID + " assigned."); m_log.Info("[RADMIN]: User " + tempfirstname + " " + templastname + " created. Userid " + tempuserID + " assigned.");
} }
} }
catch (Exception e) catch (Exception e)

View File

@ -27,6 +27,7 @@
*/ */
using System; using System;
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {

View File

@ -44,6 +44,8 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
{ {
public class AssetLoaderFileSystem : IAssetLoader public class AssetLoaderFileSystem : IAssetLoader
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected AssetBase CreateAsset(string assetIdStr, string name, string path, bool isImage) protected AssetBase CreateAsset(string assetIdStr, string name, string path, bool isImage)
{ {
AssetBase asset = new AssetBase( AssetBase asset = new AssetBase(
@ -53,13 +55,13 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
if (!String.IsNullOrEmpty(path)) if (!String.IsNullOrEmpty(path))
{ {
MainLog.Instance.Verbose("ASSETS", "Loading: [{0}][{1}]", name, path); m_log.Info(String.Format("[ASSETS]: Loading: [{0}][{1}]", name, path));
LoadAsset(asset, isImage, path); LoadAsset(asset, isImage, path);
} }
else else
{ {
MainLog.Instance.Verbose("ASSETS", "Instantiated: [{0}]", name); m_log.Info(String.Format("[ASSETS]: Instantiated: [{0}]", name));
} }
return asset; return asset;
@ -106,14 +108,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
} }
catch (XmlException e) catch (XmlException e)
{ {
MainLog.Instance.Error("ASSETS", "Error loading {0} : {1}", assetSetPath, e); m_log.Error(String.Format("[ASSETS]: Error loading {0} : {1}", assetSetPath, e));
} }
} }
else else
{ {
MainLog.Instance.Error( m_log.Error("[ASSETS]: Asset set control file assets/AssetSets.xml does not exist! No assets loaded.");
"ASSETS",
"Asset set control file assets/AssetSets.xml does not exist! No assets loaded.");
} }
assets.ForEach(action); assets.ForEach(action);
@ -126,7 +126,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
/// <param name="assets"></param> /// <param name="assets"></param>
protected void LoadXmlAssetSet(string assetSetPath, List<AssetBase> assets) protected void LoadXmlAssetSet(string assetSetPath, List<AssetBase> assets)
{ {
MainLog.Instance.Verbose("ASSETS", "Loading asset set {0}", assetSetPath); m_log.Info(String.Format("[ASSETS]: Loading asset set {0}", assetSetPath));
if (File.Exists(assetSetPath)) if (File.Exists(assetSetPath))
{ {
@ -152,12 +152,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
} }
catch (XmlException e) catch (XmlException e)
{ {
MainLog.Instance.Error("ASSETS", "Error loading {0} : {1}", assetSetPath, e); m_log.Error(String.Format("[ASSETS]: Error loading {0} : {1}", assetSetPath, e));
} }
} }
else else
{ {
MainLog.Instance.Error("ASSETS", "Asset set file {0} does not exist!", assetSetPath); m_log.Error(String.Format("[ASSETS]: Asset set file {0} does not exist!", assetSetPath));
} }
} }
} }

View File

@ -36,11 +36,12 @@ namespace OpenSim.Framework
public class ClientManager public class ClientManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<uint, IClientAPI> m_clients; private Dictionary<uint, IClientAPI> m_clients;
public void ForEachClient(ForEachClientDelegate whatToDo) public void ForEachClient(ForEachClientDelegate whatToDo)
{ {
// Wasteful, I know // Wasteful, I know
IClientAPI[] LocalClients = new IClientAPI[0]; IClientAPI[] LocalClients = new IClientAPI[0];
lock (m_clients) lock (m_clients)
@ -57,7 +58,7 @@ namespace OpenSim.Framework
} }
catch (System.Exception e) catch (System.Exception e)
{ {
OpenSim.Framework.Console.MainLog.Instance.Warn("CLIENT", "Unable to do ForEachClient for one of the clients" + "\n Reason: " + e.ToString()); m_log.Warn("[CLIENT]: Unable to do ForEachClient for one of the clients" + "\n Reason: " + e.ToString());
} }
} }
} }
@ -116,11 +117,9 @@ namespace OpenSim.Framework
} }
catch (System.Exception e) catch (System.Exception e)
{ {
OpenSim.Framework.Console.MainLog.Instance.Error("CLIENT", string.Format("Unable to shutdown circuit for: {0}\n Reason: {1}", agentId, e)); m_log.Error(string.Format("[CLIENT]: Unable to shutdown circuit for: {0}\n Reason: {1}", agentId, e));
} }
} }
} }
private uint[] GetAllCircuits(LLUUID agentId) private uint[] GetAllCircuits(LLUUID agentId)
@ -134,7 +133,6 @@ namespace OpenSim.Framework
m_clients.Values.CopyTo(LocalClients, 0); m_clients.Values.CopyTo(LocalClients, 0);
} }
for (int i = 0; i < LocalClients.Length; i++ ) for (int i = 0; i < LocalClients.Length; i++ )
{ {
if (LocalClients[i].AgentId == agentId) if (LocalClients[i].AgentId == agentId)
@ -160,7 +158,6 @@ namespace OpenSim.Framework
m_clients.Values.CopyTo(LocalClients, 0); m_clients.Values.CopyTo(LocalClients, 0);
} }
for (int i = 0; i < LocalClients.Length; i++) for (int i = 0; i < LocalClients.Length; i++)
{ {
if (LocalClients[i].AgentId != sender.AgentId) if (LocalClients[i].AgentId != sender.AgentId)

View File

@ -44,6 +44,8 @@ namespace OpenSim.Framework.Communications.Cache
/// </summary> /// </summary>
public class AssetCache : IAssetReceiver public class AssetCache : IAssetReceiver
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public Dictionary<LLUUID, AssetInfo> Assets; public Dictionary<LLUUID, AssetInfo> Assets;
public Dictionary<LLUUID, TextureImage> Textures; public Dictionary<LLUUID, TextureImage> Textures;
@ -61,14 +63,13 @@ namespace OpenSim.Framework.Communications.Cache
private readonly IAssetServer m_assetServer; private readonly IAssetServer m_assetServer;
private readonly Thread m_assetCacheThread; private readonly Thread m_assetCacheThread;
private readonly LogBase m_log;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public AssetCache(IAssetServer assetServer, LogBase log) public AssetCache(IAssetServer assetServer)
{ {
log.Verbose("ASSETSTORAGE", "Creating Asset cache"); m_log.Info("[ASSETSTORAGE]: Creating Asset cache");
m_assetServer = assetServer; m_assetServer = assetServer;
m_assetServer.SetReceiver(this); m_assetServer.SetReceiver(this);
Assets = new Dictionary<LLUUID, AssetInfo>(); Assets = new Dictionary<LLUUID, AssetInfo>();
@ -76,8 +77,6 @@ namespace OpenSim.Framework.Communications.Cache
m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
m_assetCacheThread.IsBackground = true; m_assetCacheThread.IsBackground = true;
m_assetCacheThread.Start(); m_assetCacheThread.Start();
m_log = log;
} }
/// <summary> /// <summary>
@ -94,7 +93,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("ASSETCACHE", e.ToString()); m_log.Error("[ASSETCACHE]: " + e.ToString());
} }
} }
} }
@ -198,8 +197,8 @@ namespace OpenSim.Framework.Communications.Cache
} }
} while (--maxPolls > 0); } while (--maxPolls > 0);
MainLog.Instance.Warn( m_log.Warn(
"ASSETCACHE", "Asset {0} was not received before the retrieval timeout was reached"); String.Format("[ASSETCACHE]: Asset {0} was not received before the retrieval timeout was reached"));
return null; return null;
} }
@ -266,7 +265,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
m_log.Verbose("ASSETCACHE", "Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); m_log.Info(String.Format("[ASSETCACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result));
} }
public void DeleteAsset(LLUUID assetID) public void DeleteAsset(LLUUID assetID)
@ -362,7 +361,7 @@ namespace OpenSim.Framework.Communications.Cache
{ {
//if (this.RequestedTextures.ContainsKey(assetID)) //if (this.RequestedTextures.ContainsKey(assetID))
//{ //{
// MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID); // m_log.Warn(String.Format("[ASSET CACHE]: sending image not found for {0}", assetID));
// AssetRequest req = this.RequestedTextures[assetID]; // AssetRequest req = this.RequestedTextures[assetID];
// ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); // ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
// notFound.ImageID.ID = assetID; // notFound.ImageID.ID = assetID;
@ -371,7 +370,7 @@ namespace OpenSim.Framework.Communications.Cache
//} //}
//else //else
//{ //{
// MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID); // m_log.Error(String.Format("[ASSET CACHE]: Cound not send image not found for {0}", assetID));
//} //}
} }

View File

@ -35,6 +35,8 @@ namespace OpenSim.Framework.Communications.Cache
{ {
public class LocalAssetServer : AssetServerBase public class LocalAssetServer : AssetServerBase
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private IObjectContainer db; private IObjectContainer db;
public LocalAssetServer() public LocalAssetServer()
@ -43,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache
yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap")); yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap"));
db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap")); db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap"));
MainLog.Instance.Verbose("ASSETS", "Db4 Asset database creation"); m_log.Info("[ASSETS]: Db4 Asset database creation");
if (!yapfile) if (!yapfile)
{ {
@ -67,7 +69,7 @@ namespace OpenSim.Framework.Communications.Cache
if (db != null) if (db != null)
{ {
MainLog.Instance.Verbose("ASSETSERVER", "Closing local asset server database"); m_log.Info("[ASSETSERVER]: Closing local asset server database");
db.Close(); db.Close();
} }
} }
@ -120,7 +122,7 @@ namespace OpenSim.Framework.Communications.Cache
protected virtual void SetUpAssetDatabase() protected virtual void SetUpAssetDatabase()
{ {
MainLog.Instance.Verbose("LOCAL ASSET SERVER", "Setting up asset database"); m_log.Info("[LOCAL ASSET SERVER]: Setting up asset database");
base.LoadDefaultAssets(); base.LoadDefaultAssets();
} }

View File

@ -37,6 +37,8 @@ namespace OpenSim.Framework.Communications.Cache
{ {
public abstract class AssetServerBase : IAssetServer public abstract class AssetServerBase : IAssetServer
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected IAssetReceiver m_receiver; protected IAssetReceiver m_receiver;
protected BlockingQueue<AssetRequest> m_assetRequests; protected BlockingQueue<AssetRequest> m_assetRequests;
protected Thread m_localAssetServerThread; protected Thread m_localAssetServerThread;
@ -68,15 +70,15 @@ namespace OpenSim.Framework.Communications.Cache
if (asset != null) if (asset != null)
{ {
//MainLog.Instance.Verbose( //m_log.Info(
// "ASSET", "Asset {0} received from asset server", req.AssetID); // String.Format("[ASSET]: Asset {0} received from asset server", req.AssetID));
m_receiver.AssetReceived(asset, req.IsTexture); m_receiver.AssetReceived(asset, req.IsTexture);
} }
else else
{ {
MainLog.Instance.Error( m_log.Error(
"ASSET", "Asset {0} not found by asset server", req.AssetID); String.Format("[ASSET]: Asset {0} not found by asset server", req.AssetID));
m_receiver.AssetNotFound(req.AssetID); m_receiver.AssetNotFound(req.AssetID);
} }
@ -84,7 +86,7 @@ namespace OpenSim.Framework.Communications.Cache
public virtual void LoadDefaultAssets() public virtual void LoadDefaultAssets()
{ {
MainLog.Instance.Verbose("ASSETSERVER", "Setting up asset database"); m_log.Info("[ASSETSERVER]: Setting up asset database");
assetLoader.ForEachDefaultXmlAsset(StoreAsset); assetLoader.ForEachDefaultXmlAsset(StoreAsset);
@ -94,7 +96,7 @@ namespace OpenSim.Framework.Communications.Cache
public AssetServerBase() public AssetServerBase()
{ {
MainLog.Instance.Verbose("ASSETSERVER", "Starting asset storage system"); m_log.Info("[ASSETSERVER]: Starting asset storage system");
m_assetRequests = new BlockingQueue<AssetRequest>(); m_assetRequests = new BlockingQueue<AssetRequest>();
m_localAssetServerThread = new Thread(RunRequests); m_localAssetServerThread = new Thread(RunRequests);
@ -114,7 +116,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("ASSETSERVER", e.Message); m_log.Error("[ASSETSERVER]: " + e.Message);
} }
} }
} }
@ -131,7 +133,7 @@ namespace OpenSim.Framework.Communications.Cache
req.IsTexture = isTexture; req.IsTexture = isTexture;
m_assetRequests.Enqueue(req); m_assetRequests.Enqueue(req);
MainLog.Instance.Verbose("ASSET", "Added {0} to request queue", assetID); m_log.Info(String.Format("[ASSET]: Added {0} to request queue", assetID));
} }
public virtual void UpdateAsset(AssetBase asset) public virtual void UpdateAsset(AssetBase asset)

View File

@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications.Cache
{ {
public class GridAssetClient : AssetServerBase public class GridAssetClient : AssetServerBase
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private string _assetServerUrl; private string _assetServerUrl;
public GridAssetClient(string serverUrl) public GridAssetClient(string serverUrl)
@ -50,7 +52,7 @@ namespace OpenSim.Framework.Communications.Cache
Stream s = null; Stream s = null;
try try
{ {
MainLog.Instance.Debug("ASSETCACHE", "Querying for {0}", req.AssetID.ToString()); m_log.Debug(String.Format("[ASSETCACHE]: Querying for {0}", req.AssetID.ToString()));
RestClient rc = new RestClient(_assetServerUrl); RestClient rc = new RestClient(_assetServerUrl);
rc.AddResourcePath("assets"); rc.AddResourcePath("assets");
@ -70,9 +72,9 @@ namespace OpenSim.Framework.Communications.Cache
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("ASSETCACHE", e.Message); m_log.Error("[ASSETCACHE]: " + e.Message);
MainLog.Instance.Debug("ASSETCACHE", "Getting asset {0}", req.AssetID.ToString()); m_log.Debug(String.Format("[ASSETCACHE]: Getting asset {0}", req.AssetID.ToString()));
MainLog.Instance.Error("ASSETCACHE", e.StackTrace); m_log.Error("[ASSETCACHE]: " + e.StackTrace);
} }
return null; return null;
@ -93,19 +95,19 @@ namespace OpenSim.Framework.Communications.Cache
// XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); // XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
// xs.Serialize(s, asset); // xs.Serialize(s, asset);
// RestClient rc = new RestClient(_assetServerUrl); // RestClient rc = new RestClient(_assetServerUrl);
MainLog.Instance.Verbose("ASSET", "Storing asset"); m_log.Info("[ASSET]: Storing asset");
//rc.AddResourcePath("assets"); //rc.AddResourcePath("assets");
// rc.RequestMethod = "POST"; // rc.RequestMethod = "POST";
// rc.Request(s); // rc.Request(s);
//MainLog.Instance.Verbose("ASSET", "Stored {0}", rc); //m_log.Info(String.Format("[ASSET]: Stored {0}", rc));
MainLog.Instance.Verbose("ASSET", "Sending to " + _assetServerUrl + "/assets/"); m_log.Info("[ASSET]: Sending to " + _assetServerUrl + "/assets/");
RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset); RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset);
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("ASSETS", e.Message); m_log.Error("[ASSETS]: " + e.Message);
} }
} }

View File

@ -26,12 +26,12 @@
* *
*/ */
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using libsecondlife; using libsecondlife;
using Nini.Config; using Nini.Config;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
namespace OpenSim.Framework.Communications.Cache namespace OpenSim.Framework.Communications.Cache
@ -42,6 +42,8 @@ namespace OpenSim.Framework.Communications.Cache
/// </summary> /// </summary>
public class LibraryRootFolder : InventoryFolderImpl public class LibraryRootFolder : InventoryFolderImpl
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000"); private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
/// <summary> /// <summary>
@ -53,7 +55,7 @@ namespace OpenSim.Framework.Communications.Cache
public LibraryRootFolder() public LibraryRootFolder()
{ {
MainLog.Instance.Verbose("LIBRARYINVENTORY", "Loading library inventory"); m_log.Info("[LIBRARYINVENTORY]: Loading library inventory");
agentID = libOwner; agentID = libOwner;
folderID = new LLUUID("00000112-000f-0000-0000-000100bba000"); folderID = new LLUUID("00000112-000f-0000-0000-000100bba000");
@ -138,8 +140,8 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="assets"></param> /// <param name="assets"></param>
protected void LoadLibraries(string librariesControlPath) protected void LoadLibraries(string librariesControlPath)
{ {
MainLog.Instance.Verbose( m_log.Info(
"LIBRARYINVENTORY", "Loading libraries control file {0}", librariesControlPath); String.Format("LIBRARYINVENTORY", "Loading libraries control file {0}", librariesControlPath));
LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig); LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig);
} }
@ -186,15 +188,15 @@ namespace OpenSim.Framework.Communications.Cache
libraryFolders.Add(folderInfo.folderID, folderInfo); libraryFolders.Add(folderInfo.folderID, folderInfo);
parentFolder.SubFolders.Add(folderInfo.folderID, folderInfo); parentFolder.SubFolders.Add(folderInfo.folderID, folderInfo);
// MainLog.Instance.Verbose( // m_log.Info(
// "LIBRARYINVENTORY", "Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID); // String.Format("[LIBRARYINVENTORY]: Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID));
} }
else else
{ {
MainLog.Instance.Warn( m_log.Warn(
"LIBRARYINVENTORY", String.Format("[LIBRARYINVENTORY]: " +
"Couldn't add folder {0} ({1}) since parent folder with ID {2} does not exist!", "Couldn't add folder {0} ({1}) since parent folder with ID {2} does not exist!",
folderInfo.name, folderInfo.folderID, folderInfo.parentID); folderInfo.name, folderInfo.folderID, folderInfo.parentID));
} }
} }
@ -227,10 +229,10 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
MainLog.Instance.Warn( m_log.Warn(
"LIBRARYINVENTORY", String.Format("[LIBRARYINVENTORY]: " +
"Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", "Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
item.inventoryName, item.inventoryID, item.parentFolderID); item.inventoryName, item.inventoryID, item.parentFolderID));
} }
} }
@ -257,14 +259,14 @@ namespace OpenSim.Framework.Communications.Cache
} }
catch (XmlException e) catch (XmlException e)
{ {
MainLog.Instance.Error( m_log.Error(
"LIBRARYINVENTORY", "Error loading {0} : {1}", path, e); String.Format("[LIBRARYINVENTORY]: Error loading {0} : {1}", path, e));
} }
} }
else else
{ {
MainLog.Instance.Error( m_log.Error(
"LIBRARYINVENTORY", "{0} file {1} does not exist!", fileDescription, path); String.Format("[LIBRARYINVENTORY]: {0} file {1} does not exist!", fileDescription, path));
} }
} }

View File

@ -33,6 +33,8 @@ namespace OpenSim.Framework.Communications.Cache
{ {
public class SQLAssetServer : AssetServerBase public class SQLAssetServer : AssetServerBase
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public SQLAssetServer(string pluginName) public SQLAssetServer(string pluginName)
{ {
AddPlugin(pluginName); AddPlugin(pluginName);
@ -45,7 +47,7 @@ namespace OpenSim.Framework.Communications.Cache
public void AddPlugin(string FileName) public void AddPlugin(string FileName)
{ {
MainLog.Instance.Verbose("SQLAssetServer", "AssetStorage: Attempting to load " + FileName); m_log.Info("[SQLAssetServer]: AssetStorage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName);
foreach (Type pluginType in pluginAssembly.GetTypes()) foreach (Type pluginType in pluginAssembly.GetTypes())
@ -61,7 +63,7 @@ namespace OpenSim.Framework.Communications.Cache
m_assetProvider = plug; m_assetProvider = plug;
m_assetProvider.Initialise(); m_assetProvider.Initialise();
MainLog.Instance.Verbose("AssetStorage", m_log.Info("[AssetStorage]: " +
"Added " + m_assetProvider.Name + " " + "Added " + m_assetProvider.Name + " " +
m_assetProvider.Version); m_assetProvider.Version);
} }
@ -69,7 +71,6 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
public override void Close() public override void Close()
{ {
base.Close(); base.Close();

View File

@ -25,6 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
using System;
using System.Collections.Generic; using System.Collections.Generic;
using libsecondlife; using libsecondlife;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
@ -33,6 +35,8 @@ namespace OpenSim.Framework.Communications.Cache
{ {
public class UserProfileCacheService public class UserProfileCacheService
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Fields // Fields
private readonly CommunicationsManager m_parent; private readonly CommunicationsManager m_parent;
private readonly Dictionary<LLUUID, CachedUserInfo> m_userProfiles = new Dictionary<LLUUID, CachedUserInfo>(); private readonly Dictionary<LLUUID, CachedUserInfo> m_userProfiles = new Dictionary<LLUUID, CachedUserInfo>();
@ -69,7 +73,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
MainLog.Instance.Error("USERCACHE", "User profile for user {0} not found", userID); m_log.Error(String.Format("[USERCACHE]: User profile for user {0} not found", userID));
} }
} }
} }
@ -229,28 +233,28 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
MainLog.Instance.Error( m_log.Error(
"INVENTORYCACHE", "Could not find root folder for user {0}", remoteClient.Name); String.Format("[INVENTORYCACHE]: Could not find root folder for user {0}", remoteClient.Name));
return; return;
} }
} }
else else
{ {
MainLog.Instance.Error( m_log.Error(
"INVENTORYCACHE", String.Format("[INVENTORYCACHE]: " +
"Could not find user profile for {0} for folder {1}", "Could not find user profile for {0} for folder {1}",
remoteClient.Name, folderID); remoteClient.Name, folderID));
return; return;
} }
// If we've reached this point then we couldn't find the folder, even though the client thinks // If we've reached this point then we couldn't find the folder, even though the client thinks
// it exists // it exists
MainLog.Instance.Error( m_log.Error(
"INVENTORYCACHE", String.Format("[INVENTORYCACHE]: " +
"Could not find folder {0} for user {1}", "Could not find folder {0} for user {1}",
folderID, remoteClient.Name); folderID, remoteClient.Name));
} }
public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID)

View File

@ -54,6 +54,8 @@ namespace OpenSim.Region.Capabilities
public class Caps public class Caps
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private string m_httpListenerHostName; private string m_httpListenerHostName;
private uint m_httpListenPort; private uint m_httpListenPort;
@ -96,7 +98,7 @@ namespace OpenSim.Region.Capabilities
/// </summary> /// </summary>
public void RegisterHandlers() public void RegisterHandlers()
{ {
MainLog.Instance.Verbose("CAPS", "Registering CAPS handlers"); m_log.Info("[CAPS]: Registering CAPS handlers");
string capsBase = "/CAPS/" + m_capsObjectPath; string capsBase = "/CAPS/" + m_capsObjectPath;
try try
{ {
@ -115,7 +117,7 @@ namespace OpenSim.Region.Capabilities
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("CAPS", e.ToString()); m_log.Error("[CAPS]: " + e.ToString());
} }
} }
@ -275,7 +277,7 @@ namespace OpenSim.Region.Capabilities
{ {
try try
{ {
// MainLog.Instance.Debug("CAPS", "request: {0}, path: {1}, param: {2}", request, path, param); // m_log.Debug(String.Format("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param));
Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request));
LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate();
@ -303,16 +305,16 @@ namespace OpenSim.Region.Capabilities
uploadResponse.uploader = uploaderURL; uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload"; uploadResponse.state = "upload";
// MainLog.Instance.Verbose( // m_log.Info(
// "CAPS", // String.Format("[CAPS]: " +
// "ScriptTaskInventory response: {0}", // "ScriptTaskInventory response: {0}",
// LLSDHelpers.SerialiseLLSDReply(uploadResponse)); // LLSDHelpers.SerialiseLLSDReply(uploadResponse)));
return LLSDHelpers.SerialiseLLSDReply(uploadResponse); return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("CAPS", e.ToString()); m_log.Error("[CAPS]: " + e.ToString());
} }
return null; return null;
@ -349,10 +351,10 @@ namespace OpenSim.Region.Capabilities
uploadResponse.uploader = uploaderURL; uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload"; uploadResponse.state = "upload";
// MainLog.Instance.Verbose( // m_log.Info(
// "CAPS", // String.Format("[CAPS]: " +
// "NoteCardAgentInventory response: {0}", // "NoteCardAgentInventory response: {0}",
// LLSDHelpers.SerialiseLLSDReply(uploadResponse)); // LLSDHelpers.SerialiseLLSDReply(uploadResponse)));
return LLSDHelpers.SerialiseLLSDReply(uploadResponse); return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
} }
@ -681,10 +683,10 @@ namespace OpenSim.Region.Capabilities
{ {
try try
{ {
// MainLog.Instance.Verbose( // m_log.Info(
// "CAPS", // String.Format("[CAPS]: " +
// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}",
// data, path, param); // data, path, param));
string res = String.Empty; string res = String.Empty;
LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete();
@ -707,13 +709,13 @@ namespace OpenSim.Region.Capabilities
SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data);
} }
// MainLog.Instance.Verbose("CAPS", "TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); // m_log.Info(String.Format("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res));
return res; return res;
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("CAPS", e.ToString()); m_log.Error("[CAPS]: " + e.ToString());
} }
// XXX Maybe this should be some meaningful error packet // XXX Maybe this should be some meaningful error packet

View File

@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications
{ {
public class CommunicationsManager public class CommunicationsManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected IUserService m_userService; protected IUserService m_userService;
public IUserService UserService public IUserService UserService
@ -114,11 +116,11 @@ namespace OpenSim.Framework.Communications
if (cmmdParams.Length < 2) if (cmmdParams.Length < 2)
{ {
firstName = MainLog.Instance.CmdPrompt("First name", "Default"); firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
lastName = MainLog.Instance.CmdPrompt("Last name", "User"); lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
password = MainLog.Instance.PasswdPrompt("Password"); password = MainConsole.Instance.PasswdPrompt("Password");
regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", "1000"));
regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000")); regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", "1000"));
} }
else else
{ {

View File

@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications
{ {
public abstract class InventoryServiceBase : IInventoryServices public abstract class InventoryServiceBase : IInventoryServices
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>();
//protected IAssetServer m_assetServer; //protected IAssetServer m_assetServer;
@ -52,7 +54,7 @@ namespace OpenSim.Framework.Communications
{ {
if (!String.IsNullOrEmpty(FileName)) if (!String.IsNullOrEmpty(FileName))
{ {
MainLog.Instance.Verbose("AGENTINVENTORY", "Inventorystorage: Attempting to load " + FileName); m_log.Info("[AGENTINVENTORY]: Inventorystorage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName);
foreach (Type pluginType in pluginAssembly.GetTypes()) foreach (Type pluginType in pluginAssembly.GetTypes())
@ -67,7 +69,7 @@ namespace OpenSim.Framework.Communications
(IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(); plug.Initialise();
m_plugins.Add(plug.getName(), plug); m_plugins.Add(plug.getName(), plug);
MainLog.Instance.Verbose("AGENTINVENTORY", "Added IInventoryData Interface"); m_log.Info("[AGENTINVENTORY]: Added IInventoryData Interface");
} }
} }
} }
@ -95,9 +97,8 @@ namespace OpenSim.Framework.Communications
rootFolder = plugin.Value.getUserRootFolder(userID); rootFolder = plugin.Value.getUserRootFolder(userID);
if (rootFolder != null) if (rootFolder != null)
{ {
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "[INVENTORY]: Found root folder for user with ID " + userID + ". Retrieving inventory contents.");
"Found root folder for user with ID " + userID + ". Retrieving inventory contents.");
inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID);
inventoryList.Insert(0, rootFolder); inventoryList.Insert(0, rootFolder);
@ -105,8 +106,8 @@ namespace OpenSim.Framework.Communications
} }
} }
MainLog.Instance.Warn( m_log.Warn(
"INVENTORY", "Could not find a root folder belonging to user with ID " + userID); "[INVENTORY]: Could not find a root folder belonging to user with ID " + userID);
return inventoryList; return inventoryList;
} }
@ -226,10 +227,10 @@ namespace OpenSim.Framework.Communications
if (null != existingRootFolder) if (null != existingRootFolder)
{ {
MainLog.Instance.Error( m_log.Error(
"AGENTINVENTORY", String.Format("[AGENTINVENTORY]: " +
"Did not create a new inventory for user {0} since they already have " "Did not create a new inventory for user {0} since they already have "
+ "a root inventory folder with id {1}", user, existingRootFolder); + "a root inventory folder with id {1}", user, existingRootFolder));
} }
else else
{ {
@ -251,6 +252,7 @@ namespace OpenSim.Framework.Communications
public virtual void CreateNewInventorySet(LLUUID user) public virtual void CreateNewInventorySet(LLUUID user)
{ {
InventoryFolderBase folder = new InventoryFolderBase(); InventoryFolderBase folder = new InventoryFolderBase();
folder.parentID = LLUUID.Zero; folder.parentID = LLUUID.Zero;
folder.agentID = user; folder.agentID = user;
folder.folderID = LLUUID.Random(); folder.folderID = LLUUID.Random();

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework.UserManagement
/// </summary> /// </summary>
public class LoginResponse public class LoginResponse
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Hashtable loginFlagsHash; private Hashtable loginFlagsHash;
private Hashtable globalTexturesHash; private Hashtable globalTexturesHash;
private Hashtable loginError; private Hashtable loginError;
@ -362,10 +364,8 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn( m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message);
"CLIENT",
"LoginResponse: Error creating XML-RPC Response: " + e.Message
);
return (GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); return (GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));
} }
} // ToXmlRpcResponse } // ToXmlRpcResponse
@ -461,10 +461,8 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn( m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message);
"CLIENT",
"LoginResponse: Error creating XML-RPC Response: " + e.Message
);
return GenerateFailureResponseLLSD("Internal Error", "Error generating Login Response", "false"); return GenerateFailureResponseLLSD("Internal Error", "Error generating Login Response", "false");
} }
} }

View File

@ -44,6 +44,8 @@ namespace OpenSim.Framework.UserManagement
{ {
public class LoginService public class LoginService
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected string m_welcomeMessage = "Welcome to OpenSim"; protected string m_welcomeMessage = "Welcome to OpenSim";
protected UserManagerBase m_userManager = null; protected UserManagerBase m_userManager = null;
protected Mutex m_loginMutex = new Mutex(false); protected Mutex m_loginMutex = new Mutex(false);
@ -83,7 +85,7 @@ namespace OpenSim.Framework.UserManagement
try try
{ {
//CFK: CustomizeResponse contains sufficient strings to alleviate the need for this. //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this.
//CKF: MainLog.Instance.Verbose("LOGIN", "Attempting login now..."); //CKF: m_log.Info("[LOGIN]: Attempting login now...");
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable) request.Params[0]; Hashtable requestData = (Hashtable) request.Params[0];
@ -102,16 +104,14 @@ namespace OpenSim.Framework.UserManagement
if( requestData.Contains("version")) if( requestData.Contains("version"))
{ {
string clientversion = (string)requestData["version"]; string clientversion = (string)requestData["version"];
MainLog.Instance.Verbose("LOGIN","Client Version " + clientversion + " for " + firstname + " " + lastname); m_log.Info("[LOGIN]: Client Version " + clientversion + " for " + firstname + " " + lastname);
} }
userProfile = GetTheUser(firstname, lastname); userProfile = GetTheUser(firstname, lastname);
if (userProfile == null) if (userProfile == null)
{ {
MainLog.Instance.Verbose( m_log.Info("[LOGIN]: Could not find a profile for " + firstname + " " + lastname);
"LOGIN",
"Could not find a profile for " + firstname + " " + lastname);
return logResponse.CreateLoginFailedResponse(); return logResponse.CreateLoginFailedResponse();
} }
@ -213,7 +213,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("LOGIN", e.ToString()); m_log.Info("[LOGIN]: " + e.ToString());
return logResponse.CreateDeadRegionResponse(); return logResponse.CreateDeadRegionResponse();
//return logResponse.ToXmlRpcResponse(); //return logResponse.ToXmlRpcResponse();
} }
@ -225,10 +225,9 @@ namespace OpenSim.Framework.UserManagement
return logResponse.ToXmlRpcResponse(); return logResponse.ToXmlRpcResponse();
} }
catch (Exception e)
catch (Exception E)
{ {
MainLog.Instance.Verbose("LOGIN", E.ToString()); m_log.Info("[LOGIN]: " + e.ToString());
} }
//} //}
} }
@ -265,9 +264,7 @@ namespace OpenSim.Framework.UserManagement
userProfile = GetTheUser(firstname, lastname); userProfile = GetTheUser(firstname, lastname);
if (userProfile == null) if (userProfile == null)
{ {
MainLog.Instance.Verbose( m_log.Info("[LOGIN]: Could not find a profile for " + firstname + " " + lastname);
"LOGIN",
"Could not find a profile for " + firstname + " " + lastname);
return logResponse.CreateLoginFailedResponseLLSD(); return logResponse.CreateLoginFailedResponseLLSD();
} }
@ -345,7 +342,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Verbose("LOGIN", ex.ToString()); m_log.Info("[LOGIN]: " + ex.ToString());
return logResponse.CreateDeadRegionResponseLLSD(); return logResponse.CreateDeadRegionResponseLLSD();
} }
@ -359,7 +356,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Verbose("LOGIN", ex.ToString()); m_log.Info("[LOGIN]: " + ex.ToString());
return logResponse.CreateFailedResponseLLSD(); return logResponse.CreateFailedResponseLLSD();
} }
} }
@ -458,7 +455,7 @@ namespace OpenSim.Framework.UserManagement
string redirectURL = "about:blank?redirect-http-hack=" + System.Web.HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" + string redirectURL = "about:blank?redirect-http-hack=" + System.Web.HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" +
lastname + lastname +
"&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString()); "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString());
//MainLog.Instance.Verbose("WEB", "R:" + redirectURL); //m_log.Info("[WEB]: R:" + redirectURL);
returnactions["int_response_code"] = statuscode; returnactions["int_response_code"] = statuscode;
returnactions["str_redirect_location"] = redirectURL; returnactions["str_redirect_location"] = redirectURL;
returnactions["str_response_string"] = "<HTML><BODY>GoodLogin</BODY></HTML>"; returnactions["str_response_string"] = "<HTML><BODY>GoodLogin</BODY></HTML>";
@ -604,27 +601,22 @@ namespace OpenSim.Framework.UserManagement
public virtual bool AuthenticateUser(UserProfileData profile, string password) public virtual bool AuthenticateUser(UserProfileData profile, string password)
{ {
bool passwordSuccess = false; bool passwordSuccess = false;
MainLog.Instance.Verbose( m_log.Info(
"LOGIN", "Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); String.Format("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID));
// Web Login method seems to also occasionally send the hashed password itself // Web Login method seems to also occasionally send the hashed password itself
// we do this to get our hash in a form that the server password code can consume // we do this to get our hash in a form that the server password code can consume
// when the web-login-form submits the password in the clear (supposed to be over SSL!) // when the web-login-form submits the password in the clear (supposed to be over SSL!)
if (!password.StartsWith("$1$")) if (!password.StartsWith("$1$"))
password = "$1$" + Util.Md5Hash(password); password = "$1$" + Util.Md5Hash(password);
password = password.Remove(0, 3); //remove $1$ password = password.Remove(0, 3); //remove $1$
string s = Util.Md5Hash(password + ":" + profile.passwordSalt); string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
// Testing... // Testing...
//MainLog.Instance.Verbose("LOGIN", "SubHash:" + s + " userprofile:" + profile.passwordHash); //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash);
//MainLog.Instance.Verbose("LOGIN", "userprofile:" + profile.passwordHash + " SubCT:" + password); //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password);
passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
|| profile.passwordHash.Equals(password,StringComparison.InvariantCultureIgnoreCase)); || profile.passwordHash.Equals(password,StringComparison.InvariantCultureIgnoreCase));
@ -635,8 +627,8 @@ namespace OpenSim.Framework.UserManagement
public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey)
{ {
bool passwordSuccess = false; bool passwordSuccess = false;
MainLog.Instance.Verbose( m_log.Info(
"LOGIN", "Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); String.Format("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID));
// Match web login key unless it's the default weblogin key LLUUID.Zero // Match web login key unless it's the default weblogin key LLUUID.Zero
passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero); passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero);

View File

@ -56,6 +56,8 @@ namespace OpenSim.Framework.Communications
/// </remarks> /// </remarks>
public class RestClient public class RestClient
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private string realuri; private string realuri;
#region member variables #region member variables
@ -238,7 +240,7 @@ namespace OpenSim.Framework.Communications
} }
} }
realuri = sb.ToString(); realuri = sb.ToString();
MainLog.Instance.Verbose("REST", "RestURL: {0}", realuri); m_log.Info(String.Format("[REST]: RestURL: {0}", realuri));
return new Uri(sb.ToString()); return new Uri(sb.ToString());
} }
@ -374,16 +376,16 @@ namespace OpenSim.Framework.Communications
_asyncException = null; _asyncException = null;
_request.ContentLength = src.Length; _request.ContentLength = src.Length;
MainLog.Instance.Verbose("REST", "Request Length {0}", _request.ContentLength); m_log.Info(String.Format("[REST]: Request Length {0}", _request.ContentLength));
MainLog.Instance.Verbose("REST", "Sending Web Request {0}", buildUri()); m_log.Info(String.Format("[REST]: Sending Web Request {0}", buildUri()));
src.Seek(0, SeekOrigin.Begin); src.Seek(0, SeekOrigin.Begin);
MainLog.Instance.Verbose("REST", "Seek is ok"); m_log.Info("[REST]: Seek is ok");
Stream dst = _request.GetRequestStream(); Stream dst = _request.GetRequestStream();
MainLog.Instance.Verbose("REST", "GetRequestStream is ok"); m_log.Info("[REST]: GetRequestStream is ok");
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int length = src.Read(buf, 0, 1024); int length = src.Read(buf, 0, 1024);
MainLog.Instance.Verbose("REST", "First Read is ok"); m_log.Info("[REST]: First Read is ok");
while (length > 0) while (length > 0)
{ {
dst.Write(buf, 0, length); dst.Write(buf, 0, length);

View File

@ -43,6 +43,8 @@ namespace OpenSim.Framework.UserManagement
/// </summary> /// </summary>
public abstract class UserManagerBase : IUserService public abstract class UserManagerBase : IUserService
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public UserConfig _config; public UserConfig _config;
private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
@ -54,10 +56,10 @@ namespace OpenSim.Framework.UserManagement
{ {
if (!String.IsNullOrEmpty(FileName)) if (!String.IsNullOrEmpty(FileName))
{ {
MainLog.Instance.Verbose("USERSTORAGE", "Attempting to load " + FileName); m_log.Info("[USERSTORAGE]: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName);
MainLog.Instance.Verbose("USERSTORAGE", "Found " + pluginAssembly.GetTypes().Length + " interfaces."); m_log.Info("[USERSTORAGE]: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes()) foreach (Type pluginType in pluginAssembly.GetTypes())
{ {
if (!pluginType.IsAbstract) if (!pluginType.IsAbstract)
@ -79,7 +81,7 @@ namespace OpenSim.Framework.UserManagement
{ {
plug.Initialise(); plug.Initialise();
_plugins.Add(plug.getName(), plug); _plugins.Add(plug.getName(), plug);
MainLog.Instance.Verbose("USERSTORAGE", "Added IUserData Interface"); m_log.Info("[USERSTORAGE]: Added IUserData Interface");
} }
#region Get UserProfile #region Get UserProfile
@ -116,8 +118,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")");
"Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")");
return new List<AvatarPickerAvatar>(); return new List<AvatarPickerAvatar>();
} }
} }
@ -163,8 +164,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to set user via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to set user via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
@ -190,8 +190,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
@ -214,8 +213,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to GetUserFriendList via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
@ -234,8 +232,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to Store WebLoginKey via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to Store WebLoginKey via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
} }
@ -250,8 +247,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to AddNewUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to AddNewUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
@ -268,8 +264,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to RemoveUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to RemoveUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
} }
@ -284,8 +279,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to UpdateUserFriendPerms via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to UpdateUserFriendPerms via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
} }
@ -304,8 +298,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
@ -337,8 +330,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }
@ -454,14 +446,14 @@ namespace OpenSim.Framework.UserManagement
} }
else else
{ {
MainLog.Instance.Verbose("LOGOUT", "didn't save logout position, currentAgent is null *do Fix "); m_log.Info("[LOGOUT]: didn't save logout position, currentAgent is null *do Fix ");
} }
MainLog.Instance.Verbose("LOGOUT", userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")" ); m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")" );
MainLog.Instance.Verbose("LOGOUT", "userid: " + userid.ToString() + " regionid: " + regionid.ToString() ); m_log.Info("[LOGOUT]: userid: " + userid.ToString() + " regionid: " + regionid.ToString() );
} }
else else
{ {
MainLog.Instance.Warn("LOGOUT", "Unknown User logged out"); m_log.Warn("[LOGOUT]: Unknown User logged out");
} }
} }
@ -539,8 +531,7 @@ namespace OpenSim.Framework.UserManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Verbose("USERSTORAGE", m_log.Info("[USERSTORAGE]: Unable to add user via " + plugin.Key + "(" + e.ToString() + ")");
"Unable to add user via " + plugin.Key + "(" + e.ToString() + ")");
} }
} }

View File

@ -35,6 +35,8 @@ namespace OpenSim.Framework.Configuration.HTTP
{ {
public class HTTPConfiguration : IGenericConfig public class HTTPConfiguration : IGenericConfig
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private RemoteConfigSettings remoteConfigSettings; private RemoteConfigSettings remoteConfigSettings;
private XmlConfiguration xmlConfig; private XmlConfiguration xmlConfig;
@ -81,7 +83,7 @@ namespace OpenSim.Framework.Configuration.HTTP
} }
catch (WebException) catch (WebException)
{ {
MainLog.Instance.Warn("Unable to connect to remote configuration file (" + m_log.Warn("Unable to connect to remote configuration file (" +
remoteConfigSettings.baseConfigURL + configFileName + remoteConfigSettings.baseConfigURL + configFileName +
"). Creating local file instead."); "). Creating local file instead.");
xmlConfig.SetFileName(configFileName); xmlConfig.SetFileName(configFileName);

View File

@ -39,6 +39,8 @@ namespace OpenSim.Framework
{ {
public class ConfigurationMember public class ConfigurationMember
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result); public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result);
public delegate void ConfigurationOptionsLoad(); public delegate void ConfigurationOptionsLoad();
@ -110,7 +112,7 @@ namespace OpenSim.Framework
} }
else else
{ {
MainLog.Instance.Notice( m_log.Info(
"Required fields for adding a configuration option is invalid. Will not add this option (" + "Required fields for adding a configuration option is invalid. Will not add this option (" +
option.configurationKey + ")"); option.configurationKey + ")");
} }
@ -147,38 +149,36 @@ namespace OpenSim.Framework
checkAndAddConfigOption(configOption); checkAndAddConfigOption(configOption);
} }
// TEMP - REMOVE // TEMP - REMOVE
private int cE = 0; private int cE = 0;
public void performConfigurationRetrieve() public void performConfigurationRetrieve()
{ {
if (cE > 1) if (cE > 1)
MainLog.Instance.Error("READING CONFIGURATION COUT: " + cE.ToString()); m_log.Error("READING CONFIGURATION COUT: " + cE.ToString());
configurationPlugin = LoadConfigDll(configurationPluginFilename); configurationPlugin = LoadConfigDll(configurationPluginFilename);
configurationOptions.Clear(); configurationOptions.Clear();
if (loadFunction == null) if (loadFunction == null)
{ {
MainLog.Instance.Error("Load Function for '" + configurationDescription + m_log.Error("Load Function for '" + configurationDescription +
"' is null. Refusing to run configuration."); "' is null. Refusing to run configuration.");
return; return;
} }
if (resultFunction == null) if (resultFunction == null)
{ {
MainLog.Instance.Error("Result Function for '" + configurationDescription + m_log.Error("Result Function for '" + configurationDescription +
"' is null. Refusing to run configuration."); "' is null. Refusing to run configuration.");
return; return;
} }
MainLog.Instance.Verbose("CONFIG", "Calling Configuration Load Function..."); m_log.Info("[CONFIG]: Calling Configuration Load Function...");
loadFunction(); loadFunction();
if (configurationOptions.Count <= 0) if (configurationOptions.Count <= 0)
{ {
MainLog.Instance.Error("CONFIG", m_log.Error("[CONFIG]: No configuration options were specified for '" + configurationOptions +
"No configuration options were specified for '" + configurationOptions +
"'. Refusing to continue configuration."); "'. Refusing to continue configuration.");
return; return;
} }
@ -186,7 +186,7 @@ namespace OpenSim.Framework
bool useFile = true; bool useFile = true;
if (configurationPlugin == null) if (configurationPlugin == null)
{ {
MainLog.Instance.Error("CONFIG", "Configuration Plugin NOT LOADED!"); m_log.Error("[CONFIG]: Configuration Plugin NOT LOADED!");
return; return;
} }
@ -200,7 +200,7 @@ namespace OpenSim.Framework
} }
catch (XmlException e) catch (XmlException e)
{ {
MainLog.Instance.Error("Error loading " + configurationFilename + ": " + e.ToString()); m_log.Error("Error loading " + configurationFilename + ": " + e.ToString());
useFile = false; useFile = false;
} }
} }
@ -208,11 +208,11 @@ namespace OpenSim.Framework
{ {
if (configurationFromXMLNode != null) if (configurationFromXMLNode != null)
{ {
MainLog.Instance.Notice("Loading from XML Node, will not save to the file"); m_log.Info("Loading from XML Node, will not save to the file");
configurationPlugin.LoadDataFromString(configurationFromXMLNode.OuterXml); configurationPlugin.LoadDataFromString(configurationFromXMLNode.OuterXml);
} }
MainLog.Instance.Notice("XML Configuration Filename is not valid; will not save to the file."); m_log.Info("XML Configuration Filename is not valid; will not save to the file.");
useFile = false; useFile = false;
} }
@ -253,14 +253,14 @@ namespace OpenSim.Framework
if (configurationDescription.Trim() != String.Empty) if (configurationDescription.Trim() != String.Empty)
{ {
console_result = console_result =
MainLog.Instance.CmdPrompt( MainConsole.Instance.CmdPrompt(
configurationDescription + ": " + configOption.configurationQuestion, configurationDescription + ": " + configOption.configurationQuestion,
configOption.configurationDefault); configOption.configurationDefault);
} }
else else
{ {
console_result = console_result =
MainLog.Instance.CmdPrompt(configOption.configurationQuestion, MainConsole.Instance.CmdPrompt(configOption.configurationQuestion,
configOption.configurationDefault); configOption.configurationDefault);
} }
} }
@ -431,7 +431,7 @@ namespace OpenSim.Framework
if (!resultFunction(configOption.configurationKey, return_result)) if (!resultFunction(configOption.configurationKey, return_result))
{ {
MainLog.Instance.Notice( m_log.Info(
"The handler for the last configuration option denied that input, please try again."); "The handler for the last configuration option denied that input, please try again.");
convertSuccess = false; convertSuccess = false;
ignoreNextFromConfig = true; ignoreNextFromConfig = true;
@ -441,18 +441,16 @@ namespace OpenSim.Framework
{ {
if (configOption.configurationUseDefaultNoPrompt) if (configOption.configurationUseDefaultNoPrompt)
{ {
MainLog.Instance.Error("CONFIG", m_log.Error(string.Format(
string.Format( "[CONFIG]: [{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n",
"[{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n",
configOption.configurationKey, console_result, errorMessage, configOption.configurationKey, console_result, errorMessage,
configurationFilename)); configurationFilename));
convertSuccess = true; convertSuccess = true;
} }
else else
{ {
MainLog.Instance.Warn("CONFIG", m_log.Warn(string.Format(
string.Format( "[CONFIG]: [{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n",
"[{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n",
configOption.configurationKey, console_result, errorMessage, configOption.configurationKey, console_result, errorMessage,
configurationFilename)); configurationFilename));
ignoreNextFromConfig = true; ignoreNextFromConfig = true;

View File

@ -33,61 +33,28 @@ using System.Net;
namespace OpenSim.Framework.Console namespace OpenSim.Framework.Console
{ {
public enum LogPriority : int public class ConsoleBase
{ {
CRITICAL, private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
HIGH,
MEDIUM,
NORMAL,
LOW,
VERBOSE,
EXTRAVERBOSE
}
public class LogBase
{
private object m_syncRoot = new object(); private object m_syncRoot = new object();
private StreamWriter Log; public conscmd_callback m_cmdParser;
public conscmd_callback cmdparser; public string m_componentName;
public string componentname;
private bool m_verbose;
public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool verbose) public ConsoleBase(string componentname, conscmd_callback cmdparser)
{ {
this.componentname = componentname; m_componentName = componentname;
this.cmdparser = cmdparser; m_cmdParser = cmdparser;
m_verbose = verbose;
System.Console.WriteLine("Creating new local console"); System.Console.WriteLine("Creating new local console");
if (String.IsNullOrEmpty(LogFile)) m_log.Info("[" + m_componentName + "]: Started at " + DateTime.Now.ToString());
{
LogFile = componentname + ".log";
}
System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
try
{
Log = File.AppendText(LogFile);
}
catch (Exception ex)
{
System.Console.WriteLine("Unable to open log file. Do you already have another copy of OpenSim running? Permission problem?");
System.Console.WriteLine(ex.Message);
System.Console.WriteLine("");
System.Console.WriteLine("Application is terminating.");
System.Console.WriteLine("");
System.Threading.Thread.CurrentThread.Abort();
}
Log.WriteLine("========================================================================");
Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString());
} }
public void Close() public void Close()
{ {
Log.WriteLine("Shutdown at " + DateTime.Now.ToString()); m_log.Info("[" + m_componentName + "]: Shutdown at " + DateTime.Now.ToString());
Log.Close();
} }
/// <summary> /// <summary>
@ -99,23 +66,22 @@ namespace OpenSim.Framework.Console
/// <returns>an ansii color</returns> /// <returns>an ansii color</returns>
private ConsoleColor DeriveColor(string input) private ConsoleColor DeriveColor(string input)
{ {
int colIdx = (input.ToUpper().GetHashCode()%6) + 9; int colIdx = (input.ToUpper().GetHashCode() % 6) + 9;
return (ConsoleColor) colIdx; return (ConsoleColor) colIdx;
} }
/// <summary> /// <summary>
/// Sends a warning to the current log output /// Sends a warning to the current console output
/// </summary> /// </summary>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
/// <param name="args">WriteLine-style message arguments</param> /// <param name="args">WriteLine-style message arguments</param>
public void Warn(string format, params object[] args) public void Warn(string format, params object[] args)
{ {
WriteNewLine(ConsoleColor.Yellow, format, args); WriteNewLine(ConsoleColor.Yellow, format, args);
return;
} }
/// <summary> /// <summary>
/// Sends a warning to the current log output /// Sends a warning to the current console output
/// </summary> /// </summary>
/// <param name="sender">The module that sent this message</param> /// <param name="sender">The module that sent this message</param>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
@ -124,22 +90,20 @@ namespace OpenSim.Framework.Console
{ {
WritePrefixLine(DeriveColor(sender), sender); WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.Yellow, format, args); WriteNewLine(ConsoleColor.Yellow, format, args);
return;
} }
/// <summary> /// <summary>
/// Sends a notice to the current log output /// Sends a notice to the current console output
/// </summary> /// </summary>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
/// <param name="args">WriteLine-style message arguments</param> /// <param name="args">WriteLine-style message arguments</param>
public void Notice(string format, params object[] args) public void Notice(string format, params object[] args)
{ {
WriteNewLine(ConsoleColor.White, format, args); WriteNewLine(ConsoleColor.White, format, args);
return;
} }
/// <summary> /// <summary>
/// Sends a notice to the current log output /// Sends a notice to the current console output
/// </summary> /// </summary>
/// <param name="sender">The module that sent this message</param> /// <param name="sender">The module that sent this message</param>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
@ -148,22 +112,20 @@ namespace OpenSim.Framework.Console
{ {
WritePrefixLine(DeriveColor(sender), sender); WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.White, format, args); WriteNewLine(ConsoleColor.White, format, args);
return;
} }
/// <summary> /// <summary>
/// Sends an error to the current log output /// Sends an error to the current console output
/// </summary> /// </summary>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
/// <param name="args">WriteLine-style message arguments</param> /// <param name="args">WriteLine-style message arguments</param>
public void Error(string format, params object[] args) public void Error(string format, params object[] args)
{ {
WriteNewLine(ConsoleColor.Red, format, args); WriteNewLine(ConsoleColor.Red, format, args);
return;
} }
/// <summary> /// <summary>
/// Sends an error to the current log output /// Sends an error to the current console output
/// </summary> /// </summary>
/// <param name="sender">The module that sent this message</param> /// <param name="sender">The module that sent this message</param>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
@ -172,38 +134,20 @@ namespace OpenSim.Framework.Console
{ {
WritePrefixLine(DeriveColor(sender), sender); WritePrefixLine(DeriveColor(sender), sender);
Error(format, args); Error(format, args);
return;
} }
/// <summary> /// <summary>
/// Sends an informational message to the current log output /// Sends a status message to the current console output
/// </summary>
/// <param name="sender">The module that sent this message</param>
/// <param name="format">The message to send</param>
/// <param name="args">WriteLine-style message arguments</param>
public void Verbose(string sender, string format, params object[] args)
{
if (m_verbose)
{
WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.Gray, format, args);
return;
}
}
/// <summary>
/// Sends a status message to the current log output
/// </summary> /// </summary>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
/// <param name="args">WriteLine-style message arguments</param> /// <param name="args">WriteLine-style message arguments</param>
public void Status(string format, params object[] args) public void Status(string format, params object[] args)
{ {
WriteNewLine(ConsoleColor.Blue, format, args); WriteNewLine(ConsoleColor.Blue, format, args);
return;
} }
/// <summary> /// <summary>
/// Sends a status message to the current log output /// Sends a status message to the current console output
/// </summary> /// </summary>
/// <param name="sender">The module that sent this message</param> /// <param name="sender">The module that sent this message</param>
/// <param name="format">The message to send</param> /// <param name="format">The message to send</param>
@ -212,14 +156,12 @@ namespace OpenSim.Framework.Console
{ {
WritePrefixLine(DeriveColor(sender), sender); WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.Blue, format, args); WriteNewLine(ConsoleColor.Blue, format, args);
return;
} }
[Conditional("DEBUG")] [Conditional("DEBUG")]
public void Debug(string format, params object[] args) public void Debug(string format, params object[] args)
{ {
WriteNewLine(ConsoleColor.Gray, format, args); WriteNewLine(ConsoleColor.Gray, format, args);
return;
} }
[Conditional("DEBUG")] [Conditional("DEBUG")]
@ -227,7 +169,6 @@ namespace OpenSim.Framework.Console
{ {
WritePrefixLine(DeriveColor(sender), sender); WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.Gray, format, args); WriteNewLine(ConsoleColor.Gray, format, args);
return;
} }
private void WriteNewLine(ConsoleColor color, string format, params object[] args) private void WriteNewLine(ConsoleColor color, string format, params object[] args)
@ -236,19 +177,16 @@ namespace OpenSim.Framework.Console
{ {
lock (m_syncRoot) lock (m_syncRoot)
{ {
string now = DateTime.Now.ToString("[MM-dd HH:mm:ss] ");
Log.Write(now);
try try
{ {
Log.WriteLine(format, args); System.Console.WriteLine(format, args);
Log.Flush();
} }
catch (FormatException) catch (FormatException)
{ {
System.Console.WriteLine(args); System.Console.WriteLine(args);
} }
System.Console.Write(now);
try try
{ {
if (color != ConsoleColor.White) if (color != ConsoleColor.White)
@ -267,13 +205,10 @@ namespace OpenSim.Framework.Console
// Some older systems dont support coloured text. // Some older systems dont support coloured text.
System.Console.WriteLine(args); System.Console.WriteLine(args);
} }
return;
} }
} }
catch (ObjectDisposedException) catch (ObjectDisposedException)
{ {
return;
} }
} }
@ -285,10 +220,7 @@ namespace OpenSim.Framework.Console
{ {
sender = sender.ToUpper(); sender = sender.ToUpper();
Log.WriteLine("[" + sender + "] "); System.Console.WriteLine("[" + sender + "] ");
Log.Flush();
System.Console.Write("["); System.Console.Write("[");
@ -305,37 +237,29 @@ namespace OpenSim.Framework.Console
} }
System.Console.Write("] \t"); System.Console.Write("] \t");
return;
} }
} }
catch (ObjectDisposedException) catch (ObjectDisposedException)
{ {
return;
} }
} }
public string ReadLine() public string ReadLine()
{ {
try try
{ {
string TempStr = System.Console.ReadLine(); return System.Console.ReadLine();
Log.WriteLine(TempStr);
return TempStr;
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("Console", "System.Console.ReadLine exception " + e.ToString()); m_log.Error("[Console]: System.Console.ReadLine exception " + e.ToString());
return String.Empty; return String.Empty;
} }
} }
public int Read() public int Read()
{ {
int TempInt = System.Console.Read(); return System.Console.Read();
Log.Write((char) TempInt);
return TempInt;
} }
public IPAddress CmdPromptIPAddress(string prompt, string defaultvalue) public IPAddress CmdPromptIPAddress(string prompt, string defaultvalue)
@ -345,14 +269,14 @@ namespace OpenSim.Framework.Console
while (true) while (true)
{ {
addressStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue); addressStr = CmdPrompt(prompt, defaultvalue);
if (IPAddress.TryParse(addressStr, out address)) if (IPAddress.TryParse(addressStr, out address))
{ {
break; break;
} }
else else
{ {
MainLog.Instance.Error("Illegal address. Please re-enter."); m_log.Error("Illegal address. Please re-enter.");
} }
} }
@ -366,7 +290,7 @@ namespace OpenSim.Framework.Console
while (true) while (true)
{ {
portStr = MainLog.Instance.CmdPrompt(prompt, defaultvalue); portStr = CmdPrompt(prompt, defaultvalue);
if (uint.TryParse(portStr, out port)) if (uint.TryParse(portStr, out port))
{ {
if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort) if (port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort)
@ -375,7 +299,7 @@ namespace OpenSim.Framework.Console
} }
} }
MainLog.Instance.Error("Illegal address. Please re-enter."); m_log.Error("Illegal address. Please re-enter.");
} }
return port; return port;
@ -386,8 +310,6 @@ namespace OpenSim.Framework.Console
public string PasswdPrompt(string prompt) public string PasswdPrompt(string prompt)
{ {
// FIXME: Needs to be better abstracted // FIXME: Needs to be better abstracted
Log.WriteLine(prompt);
Notice(prompt);
ConsoleColor oldfg = System.Console.ForegroundColor; ConsoleColor oldfg = System.Console.ForegroundColor;
System.Console.ForegroundColor = System.Console.BackgroundColor; System.Console.ForegroundColor = System.Console.BackgroundColor;
string temp = System.Console.ReadLine(); string temp = System.Console.ReadLine();
@ -398,7 +320,7 @@ namespace OpenSim.Framework.Console
// Displays a command prompt and waits for the user to enter a string, then returns that string // Displays a command prompt and waits for the user to enter a string, then returns that string
public string CmdPrompt(string prompt) public string CmdPrompt(string prompt)
{ {
Notice(String.Format("{0}: ", prompt)); System.Console.WriteLine(String.Format("{0}: ", prompt));
return ReadLine(); return ReadLine();
} }
@ -429,7 +351,7 @@ namespace OpenSim.Framework.Console
} }
else else
{ {
Notice("Valid options are " + OptionA + " or " + OptionB); System.Console.WriteLine("Valid options are " + OptionA + " or " + OptionB);
temp = CmdPrompt(prompt, defaultresponse); temp = CmdPrompt(prompt, defaultresponse);
} }
} }
@ -439,23 +361,23 @@ namespace OpenSim.Framework.Console
// Runs a command with a number of parameters // Runs a command with a number of parameters
public Object RunCmd(string Cmd, string[] cmdparams) public Object RunCmd(string Cmd, string[] cmdparams)
{ {
cmdparser.RunCmd(Cmd, cmdparams); m_cmdParser.RunCmd(Cmd, cmdparams);
return null; return null;
} }
// Shows data about something // Shows data about something
public void ShowCommands(string ShowWhat) public void ShowCommands(string ShowWhat)
{ {
cmdparser.Show(ShowWhat); m_cmdParser.Show(ShowWhat);
} }
public void MainLogPrompt() public void Prompt()
{ {
string tempstr = CmdPrompt(componentname + "# "); string tempstr = CmdPrompt(m_componentName + "# ");
MainLogRunCommand(tempstr); RunCommand(tempstr);
} }
public void MainLogRunCommand(string command) public void RunCommand(string command)
{ {
string[] tempstrarray; string[] tempstrarray;
tempstrarray = command.Split(' '); tempstrarray = command.Split(' ');
@ -470,7 +392,7 @@ namespace OpenSim.Framework.Console
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("Console", "Command failed with exception " + e.ToString()); m_log.Error("[Console]: Command failed with exception " + e.ToString());
} }
} }

View File

@ -25,13 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
namespace OpenSim.Framework.Console namespace OpenSim.Framework.Console
{ {
public class MainLog public class MainConsole
{ {
private static LogBase instance; private static ConsoleBase instance;
public static LogBase Instance public static ConsoleBase Instance
{ {
get { return instance; } get { return instance; }
set { instance = value; } set { instance = value; }

View File

@ -37,6 +37,8 @@ namespace OpenSim.Framework.Data.DB4o
/// </summary> /// </summary>
public class DB4oUserData : IUserData public class DB4oUserData : IUserData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database manager /// The database manager
/// </summary> /// </summary>
@ -143,22 +145,22 @@ namespace OpenSim.Framework.Data.DB4o
public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
{ {
//MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called"); //m_log.Info("[FRIEND]: Stub AddNewUserFriend called");
} }
public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
{ {
//MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called"); //m_log.Info("[FRIEND]: Stub RemoveUserFriend called");
} }
public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
{ {
//MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called"); //m_log.Info("[FRIEND]: Stub UpdateUserFriendPerms called");
} }
public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
{ {
//MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called"); //m_log.Info("[FRIEND]: Stub GetUserFriendList called");
return new List<FriendListItem>(); return new List<FriendListItem>();
} }
@ -166,7 +168,7 @@ namespace OpenSim.Framework.Data.DB4o
public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
{ {
//MainLog.Instance.Verbose("USER", "Stub UpdateUserCUrrentRegion called"); //m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
} }

View File

@ -37,6 +37,8 @@ namespace OpenSim.Framework.Data.MSSQL
{ {
internal class MSSQLAssetData : IAssetProvider internal class MSSQLAssetData : IAssetProvider
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private MSSQLManager database; private MSSQLManager database;
#region IAssetProvider Members #region IAssetProvider Members
@ -46,7 +48,7 @@ namespace OpenSim.Framework.Data.MSSQL
// null as the version, indicates that the table didn't exist // null as the version, indicates that the table didn't exist
if (tableName == null) if (tableName == null)
{ {
MainLog.Instance.Notice("ASSETS", "Creating new database tables"); m_log.Info("[ASSETS]: Creating new database tables");
database.ExecuteResourceSql("CreateAssetsTable.sql"); database.ExecuteResourceSql("CreateAssetsTable.sql");
return; return;
} }
@ -164,7 +166,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }

View File

@ -40,6 +40,8 @@ namespace OpenSim.Framework.Data.MSSQL
/// </summary> /// </summary>
public class SqlGridData : IGridData public class SqlGridData : IGridData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Database manager /// Database manager
/// </summary> /// </summary>
@ -172,7 +174,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -208,7 +210,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }

View File

@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.MSSQL
/// </summary> /// </summary>
public class MSSQLInventoryData : IInventoryData public class MSSQLInventoryData : IInventoryData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database manager /// The database manager
/// </summary> /// </summary>
@ -159,7 +161,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -198,7 +200,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -244,7 +246,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -282,7 +284,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -315,7 +317,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (SqlException e) catch (SqlException e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return null; return null;
@ -352,7 +354,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return null; return null;
} }
@ -377,7 +379,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return null; return null;
@ -412,7 +414,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -452,7 +454,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (SqlException e) catch (SqlException e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -511,7 +513,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -533,7 +535,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (SqlException e) catch (SqlException e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -564,7 +566,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -602,7 +604,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -628,7 +630,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -675,7 +677,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (SqlException e) catch (SqlException e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -695,7 +697,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (SqlException e) catch (SqlException e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MSSQL
/// </summary> /// </summary>
internal class MSSQLManager internal class MSSQLManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database connection object /// The database connection object
/// </summary> /// </summary>
@ -92,7 +94,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("DATASTORE", "MSSQL Database doesn't exist... creating"); m_log.Info("[DATASTORE]: MSSQL Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
cmd = Query("select top 1 webLoginKey from users", new Dictionary<string, string>()); cmd = Query("select top 1 webLoginKey from users", new Dictionary<string, string>());
@ -260,7 +262,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("Unable to reconnect to database " + e.ToString()); m_log.Error("Unable to reconnect to database " + e.ToString());
} }
} }
} }
@ -529,7 +531,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("MSSQLManager : " + e.ToString()); m_log.Error("MSSQLManager : " + e.ToString());
} }
return returnval; return returnval;
@ -573,7 +575,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return false; return false;
} }
@ -667,7 +669,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return false; return false;
} }
@ -688,7 +690,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("Unable to execute query " + e.ToString()); m_log.Error("Unable to execute query " + e.ToString());
} }
} }
@ -721,7 +723,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
tables.Close(); tables.Close();

View File

@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.MSSQL
/// </summary> /// </summary>
internal class MSSQLUserData : IUserData internal class MSSQLUserData : IUserData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Database manager for MySQL /// Database manager for MySQL
/// </summary> /// </summary>
@ -94,7 +96,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -103,22 +105,22 @@ namespace OpenSim.Framework.Data.MSSQL
public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
{ {
MainLog.Instance.Verbose("FRIEND", "Stub AddNewUserFriend called"); m_log.Info("[FRIEND]: Stub AddNewUserFriend called");
} }
public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
{ {
MainLog.Instance.Verbose("FRIEND", "Stub RemoveUserFriend called"); m_log.Info("[FRIEND]: Stub RemoveUserFriend called");
} }
public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
{ {
MainLog.Instance.Verbose("FRIEND", "Stub UpdateUserFriendPerms called"); m_log.Info("[FRIEND]: Stub UpdateUserFriendPerms called");
} }
public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
{ {
MainLog.Instance.Verbose("FRIEND", "Stub GetUserFriendList called"); m_log.Info("[FRIEND]: Stub GetUserFriendList called");
return new List<FriendListItem>(); return new List<FriendListItem>();
} }
@ -126,7 +128,7 @@ namespace OpenSim.Framework.Data.MSSQL
public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
{ {
MainLog.Instance.Verbose("USER", "Stub UpdateUserCUrrentRegion called"); m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
} }
@ -168,7 +170,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -204,7 +206,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -235,7 +237,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -290,7 +292,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -324,7 +326,7 @@ namespace OpenSim.Framework.Data.MSSQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -426,7 +428,7 @@ namespace OpenSim.Framework.Data.MSSQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return false; return false;
} }

View File

@ -37,6 +37,8 @@ namespace OpenSim.Framework.Data.MySQL
{ {
internal class MySQLAssetData : IAssetProvider internal class MySQLAssetData : IAssetProvider
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private MySQLManager _dbConnection; private MySQLManager _dbConnection;
#region IAssetProvider Members #region IAssetProvider Members
@ -46,7 +48,7 @@ namespace OpenSim.Framework.Data.MySQL
// null as the version, indicates that the table didn't exist // null as the version, indicates that the table didn't exist
if (oldVersion == null) if (oldVersion == null)
{ {
MainLog.Instance.Notice("ASSETS", "Creating new database tables"); m_log.Info("[ASSETS]: Creating new database tables");
_dbConnection.ExecuteResourceSql("CreateAssetsTable.sql"); _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql");
return; return;
} }
@ -98,9 +100,9 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error( m_log.Error(String.Format(
"ASSETS", "MySql failure fetching asset {0}" + Environment.NewLine + e.ToString() "[ASSETS]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString()
+ Environment.NewLine + "Attempting reconnection", assetID); + Environment.NewLine + "Attempting reconnection", assetID));
_dbConnection.Reconnect(); _dbConnection.Reconnect();
} }
} }
@ -137,10 +139,10 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error( m_log.Error(String.Format(
"ASSETS", "[ASSETS]: " +
"MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString()
+ Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name));
_dbConnection.Reconnect(); _dbConnection.Reconnect();
} }
} }

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MySQL
{ {
public class MySQLDataStore : IRegionDataStore public class MySQLDataStore : IRegionDataStore
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const string m_primSelect = "select * from prims"; private const string m_primSelect = "select * from prims";
private const string m_shapeSelect = "select * from primshapes"; private const string m_shapeSelect = "select * from primshapes";
private const string m_itemsSelect = "select * from primitems"; private const string m_itemsSelect = "select * from primitems";
@ -80,7 +82,7 @@ namespace OpenSim.Framework.Data.MySQL
m_dataSet = new DataSet(); m_dataSet = new DataSet();
this.persistPrimInventories = persistPrimInventories; this.persistPrimInventories = persistPrimInventories;
MainLog.Instance.Verbose("DATASTORE", "MySql - connecting: " + connectionstring); m_log.Info("[DATASTORE]: MySql - connecting: " + connectionstring);
m_connection = new MySqlConnection(connectionstring); m_connection = new MySqlConnection(connectionstring);
MySqlCommand primSelectCmd = new MySqlCommand(m_primSelect, m_connection); MySqlCommand primSelectCmd = new MySqlCommand(m_primSelect, m_connection);
@ -148,12 +150,12 @@ namespace OpenSim.Framework.Data.MySQL
{ {
if ((prim.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) if ((prim.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
{ {
MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID); m_log.Info("[DATASTORE]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
addPrim(prim, obj.UUID, regionUUID); addPrim(prim, obj.UUID, regionUUID);
} }
else else
{ {
// MainLog.Instance.Verbose("DATASTORE", "Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID); // m_log.Info("[DATASTORE]: Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID);
} }
} }
} }
@ -163,7 +165,7 @@ namespace OpenSim.Framework.Data.MySQL
public void RemoveObject(LLUUID obj, LLUUID regionUUID) public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{ {
MainLog.Instance.Verbose("DATASTORE", "Removing obj: {0} from region: {1}", obj.UUID, regionUUID); m_log.Info(String.Format("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID));
DataTable prims = m_primTable; DataTable prims = m_primTable;
DataTable shapes = m_shapeTable; DataTable shapes = m_shapeTable;
@ -228,7 +230,7 @@ namespace OpenSim.Framework.Data.MySQL
lock (m_dataSet) lock (m_dataSet)
{ {
DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
MainLog.Instance.Verbose("DATASTORE", m_log.Info("[DATASTORE]: " +
"Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
foreach (DataRow primRow in primsForRegion) foreach (DataRow primRow in primsForRegion)
@ -251,7 +253,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
else else
{ {
MainLog.Instance.Notice( m_log.Info(
"No shape found for prim in storage, so setting default box shape"); "No shape found for prim in storage, so setting default box shape");
prim.Shape = PrimitiveBaseShape.Default; prim.Shape = PrimitiveBaseShape.Default;
} }
@ -270,7 +272,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
else else
{ {
MainLog.Instance.Notice( m_log.Info(
"No shape found for prim in storage, so setting default box shape"); "No shape found for prim in storage, so setting default box shape");
prim.Shape = PrimitiveBaseShape.Default; prim.Shape = PrimitiveBaseShape.Default;
} }
@ -284,11 +286,11 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("DATASTORE", "Failed create prim object, exception and data follows"); m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
MainLog.Instance.Verbose("DATASTORE", e.ToString()); m_log.Info("[DATASTORE]: " + e.ToString());
foreach (DataColumn col in prims.Columns) foreach (DataColumn col in prims.Columns)
{ {
MainLog.Instance.Verbose("DATASTORE", "Col: " + col.ColumnName + " => " + primRow[col]); m_log.Info("[DATASTORE]: Col: " + col.ColumnName + " => " + primRow[col]);
} }
} }
} }
@ -302,7 +304,7 @@ namespace OpenSim.Framework.Data.MySQL
/// <param name="prim"></param> /// <param name="prim"></param>
private void LoadItems(SceneObjectPart prim) private void LoadItems(SceneObjectPart prim)
{ {
//MainLog.Instance.Verbose("DATASTORE", "Loading inventory for {0}, {1}", prim.Name, prim.UUID); //m_log.Info(String.Format("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID));
DataTable dbItems = m_itemsTable; DataTable dbItems = m_itemsTable;
@ -316,7 +318,7 @@ namespace OpenSim.Framework.Data.MySQL
TaskInventoryItem item = buildItem(row); TaskInventoryItem item = buildItem(row);
inventory.Add(item); inventory.Add(item);
MainLog.Instance.Verbose("DATASTORE", "Restored item {0}, {1}", item.Name, item.ItemID); m_log.Info(String.Format("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID));
} }
prim.RestoreInventoryItems(inventory); prim.RestoreInventoryItems(inventory);
@ -332,7 +334,7 @@ namespace OpenSim.Framework.Data.MySQL
public void StoreTerrain(double[,] ter, LLUUID regionID) public void StoreTerrain(double[,] ter, LLUUID regionID)
{ {
int revision = Util.UnixTimeSinceEpoch(); int revision = Util.UnixTimeSinceEpoch();
MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString()); m_log.Info("[DATASTORE]: Storing terrain revision r" + revision.ToString());
DataTable terrain = m_dataSet.Tables["terrain"]; DataTable terrain = m_dataSet.Tables["terrain"];
lock (m_dataSet) lock (m_dataSet)
@ -384,11 +386,11 @@ namespace OpenSim.Framework.Data.MySQL
} }
else else
{ {
MainLog.Instance.Verbose("DATASTORE", "No terrain found for region"); m_log.Info("[DATASTORE]: No terrain found for region");
return null; return null;
} }
MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString()); m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString());
} }
return terret; return terret;
@ -418,7 +420,7 @@ namespace OpenSim.Framework.Data.MySQL
public void StoreLandObject(Land parcel, LLUUID regionUUID) public void StoreLandObject(Land parcel, LLUUID regionUUID)
{ {
// Does the new locking fix it? // Does the new locking fix it?
MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); m_log.Info("[DATASTORE]: Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))");
System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900)); System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900));
lock (m_dataSet) lock (m_dataSet)
@ -1214,7 +1216,7 @@ namespace OpenSim.Framework.Data.MySQL
if (!persistPrimInventories) if (!persistPrimInventories)
return; return;
MainLog.Instance.Verbose("DATASTORE", "Persisting Prim Inventory with prim ID {0}", primID); m_log.Info(String.Format("[DATASTORE]: Persisting Prim Inventory with prim ID {0}", primID));
// For now, we're just going to crudely remove all the previous inventory items // For now, we're just going to crudely remove all the previous inventory items
// no matter whether they have changed or not, and replace them with the current set. // no matter whether they have changed or not, and replace them with the current set.
@ -1225,10 +1227,10 @@ namespace OpenSim.Framework.Data.MySQL
// repalce with current inventory details // repalce with current inventory details
foreach (TaskInventoryItem newItem in items) foreach (TaskInventoryItem newItem in items)
{ {
// MainLog.Instance.Verbose( // m_log.Info(String.Format(
// "DATASTORE", // "[DATASTORE]: " +
// "Adding item {0}, {1} to prim ID {2}", // "Adding item {0}, {1} to prim ID {2}",
// newItem.Name, newItem.ItemID, newItem.ParentPartID); // newItem.Name, newItem.ItemID, newItem.ParentPartID));
DataRow newItemRow = m_itemsTable.NewRow(); DataRow newItemRow = m_itemsTable.NewRow();
fillItemRow(newItemRow, newItem); fillItemRow(newItemRow, newItem);
@ -1332,7 +1334,7 @@ namespace OpenSim.Framework.Data.MySQL
sql += subsql; sql += subsql;
sql += ")"; sql += ")";
//MainLog.Instance.Verbose("DATASTORE", "defineTable() sql {0}", sql); //m_log.Info(String.Format("[DATASTORE]: defineTable() sql {0}", sql));
return sql; return sql;
} }
@ -1463,8 +1465,8 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Error("MySql", "Error connecting to MySQL server: " + ex.Message); m_log.Error("[MySql]: Error connecting to MySQL server: " + ex.Message);
MainLog.Instance.Error("MySql", "Application is terminating!"); m_log.Error("[MySql]: Application is terminating!");
System.Threading.Thread.CurrentThread.Abort(); System.Threading.Thread.CurrentThread.Abort();
} }
} }
@ -1475,7 +1477,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Warn("MySql", "Primitives Table Already Exists: {0}", e); m_log.Warn(String.Format("[MySql]: Primitives Table Already Exists: {0}", e));
} }
try try
@ -1484,7 +1486,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Warn("MySql", "Shapes Table Already Exists: {0}", e); m_log.Warn(String.Format("[MySql]: Shapes Table Already Exists: {0}", e));
} }
try try
@ -1493,7 +1495,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Warn("MySql", "Items Table Already Exists: {0}", e); m_log.Warn(String.Format("[MySql]: Items Table Already Exists: {0}", e));
} }
try try
@ -1502,7 +1504,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Warn("MySql", "Terrain Table Already Exists: {0}", e); m_log.Warn(String.Format("[MySql]: Terrain Table Already Exists: {0}", e));
} }
try try
@ -1511,7 +1513,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Warn("MySql", "Land Table Already Exists: {0}", e); m_log.Warn(String.Format("[MySql]: Land Table Already Exists: {0}", e));
} }
try try
@ -1520,7 +1522,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Warn("MySql", "LandAccessList Table Already Exists: {0}", e); m_log.Warn(String.Format("[MySql]: LandAccessList Table Already Exists: {0}", e));
} }
conn.Close(); conn.Close();
} }
@ -1555,7 +1557,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException) catch (MySqlException)
{ {
MainLog.Instance.Verbose("DATASTORE", "MySql Database doesn't exist... creating"); m_log.Info("[DATASTORE]: MySql Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
@ -1573,7 +1575,7 @@ namespace OpenSim.Framework.Data.MySQL
{ {
if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1582,7 +1584,7 @@ namespace OpenSim.Framework.Data.MySQL
{ {
if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1593,7 +1595,7 @@ namespace OpenSim.Framework.Data.MySQL
{ {
if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1602,7 +1604,7 @@ namespace OpenSim.Framework.Data.MySQL
{ {
if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1611,7 +1613,7 @@ namespace OpenSim.Framework.Data.MySQL
{ {
if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false; return false;
} }
} }

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MySQL
/// </summary> /// </summary>
public class MySQLGridData : IGridData public class MySQLGridData : IGridData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// MySQL Database Manager /// MySQL Database Manager
/// </summary> /// </summary>
@ -168,7 +170,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -200,7 +202,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -247,7 +249,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -282,7 +284,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -316,7 +318,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -405,7 +407,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }

View File

@ -38,6 +38,8 @@ namespace OpenSim.Framework.Data.MySQL
/// </summary> /// </summary>
public class MySQLInventoryData : IInventoryData public class MySQLInventoryData : IInventoryData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database manager /// The database manager
/// </summary> /// </summary>
@ -104,8 +106,8 @@ namespace OpenSim.Framework.Data.MySQL
tableList["inventoryitems"] = null; tableList["inventoryitems"] = null;
database.GetTableVersion(tableList); database.GetTableVersion(tableList);
MainLog.Instance.Verbose("MYSQL", "Inventory Folder Version: " + tableList["inventoryfolders"]); m_log.Info("[MYSQL]: Inventory Folder Version: " + tableList["inventoryfolders"]);
MainLog.Instance.Verbose("MYSQL", "Inventory Items Version: " + tableList["inventoryitems"]); m_log.Info("[MYSQL]: Inventory Items Version: " + tableList["inventoryitems"]);
UpgradeFoldersTable(tableList["inventoryfolders"]); UpgradeFoldersTable(tableList["inventoryfolders"]);
UpgradeItemsTable(tableList["inventoryitems"]); UpgradeItemsTable(tableList["inventoryitems"]);
@ -170,7 +172,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -208,7 +210,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -254,7 +256,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -292,7 +294,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -325,7 +327,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return null; return null;
@ -362,7 +364,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return null; return null;
} }
@ -387,7 +389,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return null; return null;
@ -421,7 +423,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -459,7 +461,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (MySqlException e) catch (MySqlException e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -488,7 +490,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (MySqlException e) catch (MySqlException e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -516,7 +518,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -548,7 +550,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -593,7 +595,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (MySqlException e) catch (MySqlException e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
@ -609,7 +611,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (MySqlException e) catch (MySqlException e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MySQL
/// </summary> /// </summary>
internal class MySQLManager internal class MySQLManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database connection object /// The database connection object
/// </summary> /// </summary>
@ -71,7 +73,7 @@ namespace OpenSim.Framework.Data.MySQL
dbcon.Open(); dbcon.Open();
MainLog.Instance.Verbose("MYSQL", "Connection established"); m_log.Info("[MYSQL]: Connection established");
} }
catch (Exception e) catch (Exception e)
{ {
@ -113,7 +115,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("Unable to reconnect to database " + e.ToString()); m_log.Error("Unable to reconnect to database " + e.ToString());
} }
} }
} }
@ -194,7 +196,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
tables.Close(); tables.Close();
@ -245,7 +247,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("Unable to reconnect to database " + e.ToString()); m_log.Error("Unable to reconnect to database " + e.ToString());
} }
// Run the query again // Run the query again
@ -263,7 +265,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
// Return null if it fails. // Return null if it fails.
MainLog.Instance.Error("Failed during Query generation: " + e.ToString()); m_log.Error("Failed during Query generation: " + e.ToString());
return null; return null;
} }
} }
@ -523,7 +525,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return false; return false;
} }
@ -617,7 +619,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return false; return false;
} }
@ -726,7 +728,7 @@ namespace OpenSim.Framework.Data.MySQL
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return false; return false;
} }

View File

@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.MySQL
/// </summary> /// </summary>
internal class MySQLUserData : IUserData internal class MySQLUserData : IUserData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Database manager for MySQL /// Database manager for MySQL
/// </summary> /// </summary>
@ -119,7 +121,7 @@ namespace OpenSim.Framework.Data.MySQL
database.ExecuteResourceSql("UpgradeUsersTableToVersion2.sql"); database.ExecuteResourceSql("UpgradeUsersTableToVersion2.sql");
return; return;
} }
//MainLog.Instance.Verbose("DB","DBVers:" + oldVersion); //m_log.Info("[DB]: DBVers:" + oldVersion);
} }
/// <summary> /// <summary>
@ -164,7 +166,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -208,7 +210,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return; return;
} }
} }
@ -243,7 +245,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return; return;
} }
} }
@ -272,7 +274,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return; return;
} }
} }
@ -317,7 +319,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return Lfli; return Lfli;
} }
@ -328,7 +330,7 @@ namespace OpenSim.Framework.Data.MySQL
public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
{ {
MainLog.Instance.Verbose("USER", "Stub UpdateUserCUrrentRegion called"); m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
} }
@ -371,7 +373,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -406,7 +408,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return returnlist; return returnlist;
} }
} }
@ -437,7 +439,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -488,7 +490,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return; return;
} }
@ -525,7 +527,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
return null; return null;
} }
} }
@ -553,7 +555,7 @@ namespace OpenSim.Framework.Data.MySQL
catch (Exception e) catch (Exception e)
{ {
database.Reconnect(); database.Reconnect();
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }

View File

@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.SQLite
/// </summary> /// </summary>
public class SQLiteAssetData : SQLiteBase, IAssetProvider public class SQLiteAssetData : SQLiteBase, IAssetProvider
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database manager /// The database manager
/// </summary> /// </summary>
@ -86,10 +88,10 @@ namespace OpenSim.Framework.Data.SQLite
public void CreateAsset(AssetBase asset) public void CreateAsset(AssetBase asset)
{ {
MainLog.Instance.Verbose("SQLITE", "Creating Asset " + Util.ToRawUuidString(asset.FullID)); m_log.Info("[SQLITE]: Creating Asset " + Util.ToRawUuidString(asset.FullID));
if (ExistsAsset(asset.FullID)) if (ExistsAsset(asset.FullID))
{ {
MainLog.Instance.Verbose("SQLITE", "Asset exists, updating instead. You should fix the caller for this!"); m_log.Info("[SQLITE]: Asset exists, updating instead. You should fix the caller for this!");
UpdateAsset(asset); UpdateAsset(asset);
} }
else else
@ -135,7 +137,7 @@ namespace OpenSim.Framework.Data.SQLite
string temporary = asset.Temporary ? "Temporary" : "Stored"; string temporary = asset.Temporary ? "Temporary" : "Stored";
string local = asset.Local ? "Local" : "Remote"; string local = asset.Local ? "Local" : "Remote";
MainLog.Instance.Verbose("SQLITE", m_log.Info("[SQLITE]: " +
string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)", string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)",
asset.FullID, asset.Name, asset.Description, asset.Type, asset.FullID, asset.Name, asset.Description, asset.Type,
asset.InvType, temporary, local, asset.Data.Length)); asset.InvType, temporary, local, asset.Data.Length));
@ -174,7 +176,7 @@ namespace OpenSim.Framework.Data.SQLite
public void CommitAssets() // force a sync to the database public void CommitAssets() // force a sync to the database
{ {
MainLog.Instance.Verbose("SQLITE", "Attempting commit"); m_log.Info("[SQLITE]: Attempting commit");
// lock (ds) // lock (ds)
// { // {
// da.Update(ds, "assets"); // da.Update(ds, "assets");
@ -261,7 +263,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Verbose("SQLITE", "SQLite Database doesn't exist... creating"); m_log.Info("[SQLITE]: SQLite Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
return true; return true;

View File

@ -38,6 +38,8 @@ namespace OpenSim.Framework.Data.SQLite
{ {
public class SQLiteInventoryStore : SQLiteBase, IInventoryData public class SQLiteInventoryStore : SQLiteBase, IInventoryData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const string invItemsSelect = "select * from inventoryitems"; private const string invItemsSelect = "select * from inventoryitems";
private const string invFoldersSelect = "select * from inventoryfolders"; private const string invFoldersSelect = "select * from inventoryfolders";
@ -57,7 +59,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
string connectionString = "URI=file:" + dbfile + ",version=3"; string connectionString = "URI=file:" + dbfile + ",version=3";
MainLog.Instance.Verbose("Inventory", "Sqlite - connecting: " + dbfile); m_log.Info("[Inventory]: Sqlite - connecting: " + dbfile);
SqliteConnection conn = new SqliteConnection(connectionString); SqliteConnection conn = new SqliteConnection(connectionString);
TestTables(conn); TestTables(conn);
@ -74,12 +76,12 @@ namespace OpenSim.Framework.Data.SQLite
ds.Tables.Add(createInventoryFoldersTable()); ds.Tables.Add(createInventoryFoldersTable());
invFoldersDa.Fill(ds.Tables["inventoryfolders"]); invFoldersDa.Fill(ds.Tables["inventoryfolders"]);
setupFoldersCommands(invFoldersDa, conn); setupFoldersCommands(invFoldersDa, conn);
MainLog.Instance.Verbose("DATASTORE", "Populated Intentory Folders Definitions"); m_log.Info("[DATASTORE]: Populated Intentory Folders Definitions");
ds.Tables.Add(createInventoryItemsTable()); ds.Tables.Add(createInventoryItemsTable());
invItemsDa.Fill(ds.Tables["inventoryitems"]); invItemsDa.Fill(ds.Tables["inventoryitems"]);
setupItemsCommands(invItemsDa, conn); setupItemsCommands(invItemsDa, conn);
MainLog.Instance.Verbose("DATASTORE", "Populated Intentory Items Definitions"); m_log.Info("[DATASTORE]: Populated Intentory Items Definitions");
ds.AcceptChanges(); ds.AcceptChanges();
} }
@ -603,7 +605,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating"); m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
@ -614,7 +616,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (! tmpDS.Tables["inventoryitems"].Columns.Contains(col.ColumnName)) if (! tmpDS.Tables["inventoryitems"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false; return false;
} }
} }
@ -622,7 +624,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (! tmpDS.Tables["inventoryfolders"].Columns.Contains(col.ColumnName)) if (! tmpDS.Tables["inventoryfolders"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false; return false;
} }
} }

View File

@ -37,6 +37,8 @@ namespace OpenSim.Framework.Data.SQLite
{ {
internal class SQLiteManager : SQLiteBase internal class SQLiteManager : SQLiteBase
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private IDbConnection dbcon; private IDbConnection dbcon;
/// <summary> /// <summary>
@ -101,7 +103,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating"); m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
return true; return true;

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.SQLite
{ {
public class SQLiteRegionData : IRegionDataStore public class SQLiteRegionData : IRegionDataStore
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const string primSelect = "select * from prims"; private const string primSelect = "select * from prims";
private const string shapeSelect = "select * from primshapes"; private const string shapeSelect = "select * from primshapes";
private const string itemsSelect = "select * from primitems"; private const string itemsSelect = "select * from primitems";
@ -78,7 +80,7 @@ namespace OpenSim.Framework.Data.SQLite
ds = new DataSet(); ds = new DataSet();
MainLog.Instance.Verbose("DATASTORE", "Sqlite - connecting: " + connectionString); m_log.Info("[DATASTORE]: Sqlite - connecting: " + connectionString);
m_conn = new SqliteConnection(m_connectionString); m_conn = new SqliteConnection(m_connectionString);
m_conn.Open(); m_conn.Open();
@ -142,7 +144,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("DATASTORE", "Caught fill error on primshapes table"); m_log.Info("[DATASTORE]: Caught fill error on primshapes table");
} }
try try
@ -151,7 +153,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("DATASTORE", "Caught fill error on terrain table"); m_log.Info("[DATASTORE]: Caught fill error on terrain table");
} }
try try
@ -160,7 +162,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("DATASTORE", "Caught fill error on land table"); m_log.Info("[DATASTORE]: Caught fill error on land table");
} }
try try
@ -169,7 +171,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("DATASTORE", "Caught fill error on landaccesslist table"); m_log.Info("[DATASTORE]: Caught fill error on landaccesslist table");
} }
return; return;
} }
@ -183,29 +185,29 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if ((prim.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) if ((prim.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
{ {
MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID); m_log.Info("[DATASTORE]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
} }
else if (prim.Stopped) else if (prim.Stopped)
{ {
//MainLog.Instance.Verbose("DATASTORE", //m_log.Info("[DATASTORE]: " +
//"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); //"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID);
//addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); //addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
} }
else else
{ {
// MainLog.Instance.Verbose("DATASTORE", "Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID); // m_log.Info("[DATASTORE]: Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID);
} }
} }
} }
Commit(); Commit();
// MainLog.Instance.Verbose("Dump of prims:", ds.GetXml()); // m_log.Info("[Dump of prims]: " + ds.GetXml());
} }
public void RemoveObject(LLUUID obj, LLUUID regionUUID) public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{ {
MainLog.Instance.Verbose("DATASTORE", "Removing obj: {0} from region: {1}", obj.UUID, regionUUID); m_log.Info(String.Format("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID));
DataTable prims = ds.Tables["prims"]; DataTable prims = ds.Tables["prims"];
DataTable shapes = ds.Tables["primshapes"]; DataTable shapes = ds.Tables["primshapes"];
@ -274,7 +276,7 @@ namespace OpenSim.Framework.Data.SQLite
lock (ds) lock (ds)
{ {
DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
MainLog.Instance.Verbose("DATASTORE", m_log.Info("[DATASTORE]: " +
"Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
foreach (DataRow primRow in primsForRegion) foreach (DataRow primRow in primsForRegion)
@ -296,7 +298,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
else else
{ {
MainLog.Instance.Notice( m_log.Info(
"No shape found for prim in storage, so setting default box shape"); "No shape found for prim in storage, so setting default box shape");
prim.Shape = PrimitiveBaseShape.Default; prim.Shape = PrimitiveBaseShape.Default;
} }
@ -316,7 +318,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
else else
{ {
MainLog.Instance.Notice( m_log.Info(
"No shape found for prim in storage, so setting default box shape"); "No shape found for prim in storage, so setting default box shape");
prim.Shape = PrimitiveBaseShape.Default; prim.Shape = PrimitiveBaseShape.Default;
} }
@ -330,11 +332,11 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("DATASTORE", "Failed create prim object, exception and data follows"); m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
MainLog.Instance.Verbose("DATASTORE", e.ToString()); m_log.Info("[DATASTORE]: " + e.ToString());
foreach (DataColumn col in prims.Columns) foreach (DataColumn col in prims.Columns)
{ {
MainLog.Instance.Verbose("DATASTORE", "Col: " + col.ColumnName + " => " + primRow[col]); m_log.Info("[DATASTORE]: Col: " + col.ColumnName + " => " + primRow[col]);
} }
} }
} }
@ -348,7 +350,7 @@ namespace OpenSim.Framework.Data.SQLite
/// <param name="prim"></param> /// <param name="prim"></param>
private void LoadItems(SceneObjectPart prim) private void LoadItems(SceneObjectPart prim)
{ {
MainLog.Instance.Verbose("DATASTORE", "Loading inventory for {0}, {1}", prim.Name, prim.UUID); m_log.Info(String.Format("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID));
DataTable dbItems = ds.Tables["primitems"]; DataTable dbItems = ds.Tables["primitems"];
@ -362,7 +364,7 @@ namespace OpenSim.Framework.Data.SQLite
TaskInventoryItem item = buildItem(row); TaskInventoryItem item = buildItem(row);
inventory.Add(item); inventory.Add(item);
MainLog.Instance.Verbose("DATASTORE", "Restored item {0}, {1}", item.Name, item.ItemID); m_log.Info(String.Format("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID));
} }
prim.RestoreInventoryItems(inventory); prim.RestoreInventoryItems(inventory);
@ -383,7 +385,7 @@ namespace OpenSim.Framework.Data.SQLite
// the following is an work around for .NET. The perf // the following is an work around for .NET. The perf
// issues associated with it aren't as bad as you think. // issues associated with it aren't as bad as you think.
MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString()); m_log.Info("[DATASTORE]: Storing terrain revision r" + revision.ToString());
String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" + String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" +
" values(:RegionUUID, :Revision, :Heightfield)"; " values(:RegionUUID, :Revision, :Heightfield)";
@ -446,11 +448,11 @@ namespace OpenSim.Framework.Data.SQLite
} }
else else
{ {
MainLog.Instance.Verbose("DATASTORE", "No terrain found for region"); m_log.Info("[DATASTORE]: No terrain found for region");
return null; return null;
} }
MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString()); m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString());
} }
} }
return terret; return terret;
@ -1265,7 +1267,7 @@ namespace OpenSim.Framework.Data.SQLite
if (!persistPrimInventories) if (!persistPrimInventories)
return; return;
MainLog.Instance.Verbose("DATASTORE", "Entered StorePrimInventory with prim ID {0}", primID); m_log.Info(String.Format("[DATASTORE]: Entered StorePrimInventory with prim ID {0}", primID));
DataTable dbItems = ds.Tables["primitems"]; DataTable dbItems = ds.Tables["primitems"];
@ -1278,10 +1280,10 @@ namespace OpenSim.Framework.Data.SQLite
// repalce with current inventory details // repalce with current inventory details
foreach (TaskInventoryItem newItem in items) foreach (TaskInventoryItem newItem in items)
{ {
// MainLog.Instance.Verbose( // m_log.Info(String.Format(
// "DATASTORE", // "[DATASTORE]: ",
// "Adding item {0}, {1} to prim ID {2}", // "Adding item {0}, {1} to prim ID {2}",
// newItem.Name, newItem.ItemID, newItem.ParentPartID); // newItem.Name, newItem.ItemID, newItem.ParentPartID));
DataRow newItemRow = dbItems.NewRow(); DataRow newItemRow = dbItems.NewRow();
fillItemRow(newItemRow, newItem); fillItemRow(newItemRow, newItem);
@ -1508,7 +1510,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Warn("SQLITE", "Primitives Table Already Exists"); m_log.Warn("[SQLITE]: Primitives Table Already Exists");
} }
try try
@ -1517,7 +1519,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Warn("SQLITE", "Shapes Table Already Exists"); m_log.Warn("[SQLITE]: Shapes Table Already Exists");
} }
if (persistPrimInventories) if (persistPrimInventories)
@ -1528,7 +1530,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Warn("SQLITE", "Primitives Inventory Table Already Exists"); m_log.Warn("[SQLITE]: Primitives Inventory Table Already Exists");
} }
} }
@ -1538,7 +1540,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Warn("SQLITE", "Terrain Table Already Exists"); m_log.Warn("[SQLITE]: Terrain Table Already Exists");
} }
try try
@ -1547,7 +1549,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Warn("SQLITE", "Land Table Already Exists"); m_log.Warn("[SQLITE]: Land Table Already Exists");
} }
try try
@ -1556,7 +1558,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Warn("SQLITE", "LandAccessList Table Already Exists"); m_log.Warn("[SQLITE]: LandAccessList Table Already Exists");
} }
conn.Close(); conn.Close();
} }
@ -1596,7 +1598,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating"); m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
@ -1614,7 +1616,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1623,7 +1625,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1634,7 +1636,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1643,7 +1645,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false; return false;
} }
} }
@ -1652,7 +1654,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName)) if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName))
{ {
MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName); m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false; return false;
} }
} }

View File

@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.SQLite
/// </summary> /// </summary>
public class SQLiteUserData : SQLiteBase, IUserData public class SQLiteUserData : SQLiteBase, IUserData
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The database manager /// The database manager
/// </summary> /// </summary>
@ -89,7 +91,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Verbose("SQLITE", "userfriends table not found, creating.... "); m_log.Info("[SQLITE]: userfriends table not found, creating.... ");
InitDB(conn); InitDB(conn);
daf.Fill(ds.Tables["userfriends"]); daf.Fill(ds.Tables["userfriends"]);
} }
@ -217,7 +219,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Error("USER", "Exception getting friends list for user: " + ex.ToString()); m_log.Error("[USER]: Exception getting friends list for user: " + ex.ToString());
} }
} }
@ -231,7 +233,7 @@ namespace OpenSim.Framework.Data.SQLite
public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
{ {
MainLog.Instance.Verbose("USER", "Stub UpdateUserCUrrentRegion called"); m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
} }
@ -339,7 +341,7 @@ namespace OpenSim.Framework.Data.SQLite
DataRow row = users.Rows.Find(Util.ToRawUuidString(AgentID)); DataRow row = users.Rows.Find(Util.ToRawUuidString(AgentID));
if (row == null) if (row == null)
{ {
MainLog.Instance.Warn("WEBLOGIN", "Unable to store new web login key for non-existant user"); m_log.Warn("[WEBLOGIN]: Unable to store new web login key for non-existant user");
} }
else else
{ {
@ -411,7 +413,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
} }
MainLog.Instance.Verbose("SQLITE", m_log.Info("[SQLITE]: " +
"Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored"); "Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
// save changes off to disk // save changes off to disk
da.Update(ds, "users"); da.Update(ds, "users");
@ -775,7 +777,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (System.Exception) catch (System.Exception)
{ {
MainLog.Instance.Verbose("USERS", "users table already exists"); m_log.Info("[USERS]: users table already exists");
} }
try try
@ -784,7 +786,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (System.Exception) catch (System.Exception)
{ {
MainLog.Instance.Verbose("USERS", "userfriends table already exists"); m_log.Info("[USERS]: userfriends table already exists");
} }
conn.Close(); conn.Close();
@ -807,7 +809,7 @@ namespace OpenSim.Framework.Data.SQLite
} }
catch (SqliteSyntaxException) catch (SqliteSyntaxException)
{ {
MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating"); m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
InitDB(conn); InitDB(conn);
} }
conn.Open(); conn.Open();

View File

@ -28,11 +28,14 @@
using System; using System;
using System.IO; using System.IO;
using libsecondlife; using libsecondlife;
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
public class EstateSettings public class EstateSettings
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//Settings to this island //Settings to this island
private float m_billableFactor; private float m_billableFactor;
@ -734,7 +737,7 @@ namespace OpenSim.Framework
} }
else else
{ {
OpenSim.Framework.Console.MainLog.Instance.Error("ESTATESETTINGS", "Unable to locate estate manager : " + avatarID.ToString() + " for removal"); m_log.Error("[ESTATESETTINGS]: Unable to locate estate manager : " + avatarID.ToString() + " for removal");
} }
} }
@ -749,7 +752,7 @@ namespace OpenSim.Framework
{ {
configMember = configMember =
new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS",
loadConfigurationOptions, handleIncomingConfiguration,true); loadConfigurationOptions, handleIncomingConfiguration, true);
configMember.performConfigurationRetrieve(); configMember.performConfigurationRetrieve();
} }
} }

View File

@ -27,6 +27,7 @@
*/ */
using System; using System;
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {

View File

@ -26,6 +26,8 @@
* *
*/ */
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary> /// <summary>

View File

@ -28,6 +28,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {

View File

@ -31,6 +31,7 @@ using System.Net.Sockets;
using System.Xml; using System.Xml;
using libsecondlife; using libsecondlife;
using Nini.Config; using Nini.Config;
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
@ -176,7 +177,7 @@ namespace OpenSim.Framework
public string MasterAvatarSandboxPassword = String.Empty; public string MasterAvatarSandboxPassword = String.Empty;
// Apparently, we're applying the same estatesettings regardless of whether it's local or remote. // Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
private static EstateSettings m_estateSettings; private EstateSettings m_estateSettings;
public EstateSettings EstateSettings public EstateSettings EstateSettings
{ {
@ -196,7 +197,7 @@ namespace OpenSim.Framework
public RegionInfo(string description, string filename, bool skipConsoleConfig) public RegionInfo(string description, string filename, bool skipConsoleConfig)
{ {
configMember = configMember =
new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration,!skipConsoleConfig); new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
configMember.performConfigurationRetrieve(); configMember.performConfigurationRetrieve();
} }

View File

@ -35,6 +35,8 @@ namespace OpenSim.Framework.RegionLoader.Web
{ {
public class RegionLoaderWebServer : IRegionLoader public class RegionLoaderWebServer : IRegionLoader
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private IniConfigSource m_configSouce; private IniConfigSource m_configSouce;
public void SetIniConfigSource(IniConfigSource configSource) public void SetIniConfigSource(IniConfigSource configSource)
@ -46,7 +48,7 @@ namespace OpenSim.Framework.RegionLoader.Web
{ {
if (m_configSouce == null) if (m_configSouce == null)
{ {
MainLog.Instance.Error("WEBLOADER", "Unable to load configuration source!"); m_log.Error("[WEBLOADER]: Unable to load configuration source!");
return null; return null;
} }
else else
@ -55,16 +57,16 @@ namespace OpenSim.Framework.RegionLoader.Web
string url = startupConfig.GetString("regionload_webserver_url", System.String.Empty).Trim(); string url = startupConfig.GetString("regionload_webserver_url", System.String.Empty).Trim();
if (url == System.String.Empty) if (url == System.String.Empty)
{ {
MainLog.Instance.Error("WEBLOADER", "Unable to load webserver URL - URL was empty."); m_log.Error("[WEBLOADER]: Unable to load webserver URL - URL was empty.");
return null; return null;
} }
else else
{ {
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
webRequest.Timeout = 30000; //30 Second Timeout webRequest.Timeout = 30000; //30 Second Timeout
MainLog.Instance.Debug("WEBLOADER", "Sending Download Request..."); m_log.Debug("[WEBLOADER]: Sending Download Request...");
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
MainLog.Instance.Debug("WEBLOADER", "Downloading Region Information From Remote Server..."); m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server...");
StreamReader reader = new StreamReader(webResponse.GetResponseStream()); StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string xmlSource = System.String.Empty; string xmlSource = System.String.Empty;
string tempStr = reader.ReadLine(); string tempStr = reader.ReadLine();
@ -73,8 +75,7 @@ namespace OpenSim.Framework.RegionLoader.Web
xmlSource = xmlSource + tempStr; xmlSource = xmlSource + tempStr;
tempStr = reader.ReadLine(); tempStr = reader.ReadLine();
} }
MainLog.Instance.Debug("WEBLOADER", m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
"Done downloading region information from server. Total Bytes: " +
xmlSource.Length); xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument(); XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSource); xmlDoc.LoadXml(xmlSource);
@ -84,7 +85,7 @@ namespace OpenSim.Framework.RegionLoader.Web
int i; int i;
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
{ {
MainLog.Instance.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
regionInfos[i] = regionInfos[i] =
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false); new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false);
} }

View File

@ -41,6 +41,8 @@ namespace OpenSim.Framework.Servers
{ {
public class BaseHttpServer public class BaseHttpServer
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected Thread m_workerThread; protected Thread m_workerThread;
protected HttpListener m_httpListener; protected HttpListener m_httpListener;
protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
@ -296,7 +298,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); m_log.Warn("[HTTPD]: Error - " + ex.Message);
} }
finally finally
{ {
@ -319,7 +321,7 @@ namespace OpenSim.Framework.Servers
LLSD llsdResponse = null; LLSD llsdResponse = null;
try { llsdRequest = LLSDParser.DeserializeXml(requestBody); } try { llsdRequest = LLSDParser.DeserializeXml(requestBody); }
catch (Exception ex) { MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); } catch (Exception ex) { m_log.Warn("[HTTPD]: Error - " + ex.Message); }
if (llsdRequest != null && m_llsdHandler != null) if (llsdRequest != null && m_llsdHandler != null)
{ {
@ -348,7 +350,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); m_log.Warn("[HTTPD]: Error - " + ex.Message);
} }
finally finally
{ {
@ -396,7 +398,7 @@ namespace OpenSim.Framework.Servers
foreach (string headername in rHeaders) foreach (string headername in rHeaders)
{ {
//MainLog.Instance.Warn("HEADER", headername + "=" + request.Headers[headername]); //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
headervals[headername] = request.Headers[headername]; headervals[headername] = request.Headers[headername];
} }
@ -407,9 +409,9 @@ namespace OpenSim.Framework.Servers
if (keysvals.Contains("method")) if (keysvals.Contains("method"))
{ {
//MainLog.Instance.Warn("HTTP", "Contains Method"); //m_log.Warn("[HTTP]: Contains Method");
string method = (string) keysvals["method"]; string method = (string) keysvals["method"];
//MainLog.Instance.Warn("HTTP", requestBody); //m_log.Warn("[HTTP]: " + requestBody);
GenericHTTPMethod requestprocessor; GenericHTTPMethod requestprocessor;
bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); bool foundHandler = TryGetHTTPHandler(method, out requestprocessor);
if (foundHandler) if (foundHandler)
@ -422,13 +424,13 @@ namespace OpenSim.Framework.Servers
} }
else else
{ {
//MainLog.Instance.Warn("HTTP", "Handler Not Found"); //m_log.Warn("[HTTP]: Handler Not Found");
SendHTML404(response, host); SendHTML404(response, host);
} }
} }
else else
{ {
//MainLog.Instance.Warn("HTTP", "No Method specified"); //m_log.Warn("[HTTP]: No Method specified");
SendHTML404(response, host); SendHTML404(response, host);
} }
} }
@ -461,7 +463,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); m_log.Warn("[HTTPD]: Error - " + ex.Message);
} }
finally finally
{ {
@ -488,7 +490,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); m_log.Warn("[HTTPD]: Error - " + ex.Message);
} }
finally finally
{ {
@ -513,7 +515,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); m_log.Warn("[HTTPD]: Error - " + ex.Message);
} }
finally finally
{ {
@ -523,7 +525,7 @@ namespace OpenSim.Framework.Servers
public void Start() public void Start()
{ {
MainLog.Instance.Verbose("HTTPD", "Starting up HTTP Server"); m_log.Info("[HTTPD]: Starting up HTTP Server");
m_workerThread = new Thread(new ThreadStart(StartHTTP)); m_workerThread = new Thread(new ThreadStart(StartHTTP));
m_workerThread.IsBackground = true; m_workerThread.IsBackground = true;
@ -534,7 +536,7 @@ namespace OpenSim.Framework.Servers
{ {
try try
{ {
MainLog.Instance.Verbose("HTTPD", "Spawned main thread OK"); m_log.Info("[HTTPD]: Spawned main thread OK");
m_httpListener = new HttpListener(); m_httpListener = new HttpListener();
if (!m_ssl) if (!m_ssl)
@ -556,7 +558,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("HTTPD", "Error - " + e.Message); m_log.Warn("[HTTPD]: Error - " + e.Message);
} }
} }

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -27,7 +27,6 @@
*/ */
using System; using System;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
namespace OpenSim.Framework.Servers namespace OpenSim.Framework.Servers
@ -37,8 +36,7 @@ namespace OpenSim.Framework.Servers
/// </summary> /// </summary>
public abstract class BaseOpenSimServer public abstract class BaseOpenSimServer
{ {
protected LogBase m_log; protected ConsoleBase m_console;
protected DateTime m_startuptime; protected DateTime m_startuptime;
public BaseOpenSimServer() public BaseOpenSimServer()
@ -56,7 +54,7 @@ namespace OpenSim.Framework.Servers
switch (command) switch (command)
{ {
case "help": case "help":
m_log.Notice("show uptime - show server startup and uptime."); m_console.Notice("show uptime - show server startup and uptime.");
break; break;
case "show": case "show":
@ -77,8 +75,8 @@ namespace OpenSim.Framework.Servers
switch (ShowWhat) switch (ShowWhat)
{ {
case "uptime": case "uptime":
m_log.Notice("Server has been running since " + m_startuptime.ToString()); m_console.Notice("Server has been running since " + m_startuptime.ToString());
m_log.Notice("That is " + (DateTime.Now - m_startuptime).ToString()); m_console.Notice("That is " + (DateTime.Now - m_startuptime).ToString());
break; break;
} }
} }

View File

@ -31,7 +31,7 @@ namespace OpenSim.Framework.Servers
/* /*
public class CheckSumServer : UDPServerBase public class CheckSumServer : UDPServerBase
{ {
//protected ConsoleBase m_log; private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public CheckSumServer(int port) public CheckSumServer(int port)
: base(port) : base(port)
@ -114,7 +114,7 @@ namespace OpenSim.Framework.Servers
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Warn("CheckSumServer.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); m_log.Warn("CheckSumServer.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
} }
} }

View File

@ -27,6 +27,7 @@
*/ */
using System; using System;
using OpenSim.Framework.Console;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {

View File

@ -43,6 +43,8 @@ namespace OpenSim.Grid.AssetServer
/// </summary> /// </summary>
public class OpenAsset_Main : BaseOpenSimServer, conscmd_callback public class OpenAsset_Main : BaseOpenSimServer, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public AssetConfig m_config; public AssetConfig m_config;
public static OpenAsset_Main assetserver; public static OpenAsset_Main assetserver;
@ -55,7 +57,9 @@ namespace OpenSim.Grid.AssetServer
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
Console.WriteLine("Starting...\n"); log4net.Config.XmlConfigurator.Configure();
m_log.Info("Starting...\n");
assetserver = new OpenAsset_Main(); assetserver = new OpenAsset_Main();
assetserver.Startup(); assetserver.Startup();
@ -65,42 +69,32 @@ namespace OpenSim.Grid.AssetServer
private void Work() private void Work()
{ {
m_log.Notice("Enter help for a list of commands"); m_console.Notice("Enter help for a list of commands");
while (true) while (true)
{ {
m_log.MainLogPrompt(); m_console.Prompt();
} }
} }
private OpenAsset_Main() private OpenAsset_Main()
{ {
if (!Directory.Exists(Util.logDir())) m_console = new ConsoleBase("OpenAsset", this);
{
Directory.CreateDirectory(Util.logDir());
}
m_log = MainConsole.Instance = m_console;
new LogBase(
(Path.Combine(Util.logDir(), "opengrid-AssetServer-console.log")),
"OpenAsset",
this,
true);
MainLog.Instance = m_log;
} }
public void Startup() public void Startup()
{ {
m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml")));
m_log.Verbose("ASSET", "Setting up asset DB"); m_log.Info("[ASSET]: Setting up asset DB");
setupDB(m_config); setupDB(m_config);
m_log.Verbose("ASSET", "Loading default asset set.."); m_log.Info("[ASSET]: Loading default asset set..");
LoadDefaultAssets(); LoadDefaultAssets();
m_log.Verbose("ASSET", "Starting HTTP process"); m_log.Info("[ASSET]: Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
StatsManager.StartCollectingAssetStats(); StatsManager.StartCollectingAssetStats();
@ -118,7 +112,7 @@ namespace OpenSim.Grid.AssetServer
public IAssetProvider LoadDatabasePlugin(string FileName) public IAssetProvider LoadDatabasePlugin(string FileName)
{ {
MainLog.Instance.Verbose("ASSET SERVER", "LoadDatabasePlugin: Attempting to load " + FileName); m_log.Info("[ASSET SERVER]: LoadDatabasePlugin: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName);
IAssetProvider assetPlugin = null; IAssetProvider assetPlugin = null;
foreach (Type pluginType in pluginAssembly.GetTypes()) foreach (Type pluginType in pluginAssembly.GetTypes())
@ -134,7 +128,7 @@ namespace OpenSim.Grid.AssetServer
assetPlugin = plug; assetPlugin = plug;
assetPlugin.Initialise(); assetPlugin.Initialise();
MainLog.Instance.Verbose("ASSET SERVER", "Added " + assetPlugin.Name + " " + assetPlugin.Version); m_log.Info("[ASSET SERVER]: Added " + assetPlugin.Name + " " + assetPlugin.Version);
break; break;
} }
@ -153,14 +147,14 @@ namespace OpenSim.Grid.AssetServer
m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider); m_assetProvider = LoadDatabasePlugin(config.DatabaseProvider);
if (m_assetProvider == null) if (m_assetProvider == null)
{ {
MainLog.Instance.Error("ASSET", "Failed to load a database plugin, server halting"); m_log.Error("[ASSET]: Failed to load a database plugin, server halting");
Environment.Exit(-1); Environment.Exit(-1);
} }
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("ASSET", "setupDB() - Exception occured"); m_log.Warn("[ASSET]: setupDB() - Exception occured");
MainLog.Instance.Warn("ASSET", e.ToString()); m_log.Warn("[ASSET]: " + e.ToString());
} }
} }
@ -181,18 +175,18 @@ namespace OpenSim.Grid.AssetServer
switch (cmd) switch (cmd)
{ {
case "help": case "help":
m_log.Notice( m_console.Notice(
@"shutdown - shutdown this asset server (USE CAUTION!) @"shutdown - shutdown this asset server (USE CAUTION!)
stats - statistical information for this server"); stats - statistical information for this server");
break; break;
case "stats": case "stats":
m_log.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); m_console.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report());
break; break;
case "shutdown": case "shutdown":
m_log.Close(); m_console.Close();
Environment.Exit(0); Environment.Exit(0);
break; break;
} }

View File

@ -41,6 +41,8 @@ namespace OpenSim.Grid.AssetServer
{ {
public class GetAssetStreamHandler : BaseStreamHandler public class GetAssetStreamHandler : BaseStreamHandler
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private OpenAsset_Main m_assetManager; private OpenAsset_Main m_assetManager;
private IAssetProvider m_assetProvider; private IAssetProvider m_assetProvider;
@ -52,7 +54,7 @@ namespace OpenSim.Grid.AssetServer
public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider)
: base("GET", "/assets") : base("GET", "/assets")
{ {
MainLog.Instance.Verbose("REST", "In Get Request"); m_log.Info("[REST]: In Get Request");
m_assetManager = assetManager; m_assetManager = assetManager;
m_assetProvider = assetProvider; m_assetProvider = assetProvider;
} }
@ -71,8 +73,8 @@ namespace OpenSim.Grid.AssetServer
if (!LLUUID.TryParse(p[0], out assetID)) if (!LLUUID.TryParse(p[0], out assetID))
{ {
MainLog.Instance.Verbose( m_log.Info(String.Format(
"REST", "GET:/asset ignoring request with malformed UUID {0}", p[0]); "[REST]: GET:/asset ignoring request with malformed UUID {0}", p[0]));
return result; return result;
} }
@ -94,10 +96,9 @@ namespace OpenSim.Grid.AssetServer
result = ms.GetBuffer(); result = ms.GetBuffer();
MainLog.Instance.Verbose( m_log.Info(String.Format(
"REST", "[REST]: GET:/asset found {0} with name {1}, size {2} bytes",
"GET:/asset found {0} with name {1}, size {2} bytes", assetID, asset.Name, result.Length));
assetID, asset.Name, result.Length);
Array.Resize<byte>(ref result, (int) ms.Length); Array.Resize<byte>(ref result, (int) ms.Length);
} }
@ -106,13 +107,13 @@ namespace OpenSim.Grid.AssetServer
if (StatsManager.AssetStats != null) if (StatsManager.AssetStats != null)
StatsManager.AssetStats.AddNotFoundRequest(); StatsManager.AssetStats.AddNotFoundRequest();
MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID); m_log.Info(String.Format("[REST]: GET:/asset failed to find {0}", assetID));
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
} }
return result; return result;
} }
@ -120,6 +121,8 @@ namespace OpenSim.Grid.AssetServer
public class PostAssetStreamHandler : BaseStreamHandler public class PostAssetStreamHandler : BaseStreamHandler
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private OpenAsset_Main m_assetManager; private OpenAsset_Main m_assetManager;
private IAssetProvider m_assetProvider; private IAssetProvider m_assetProvider;
@ -135,7 +138,7 @@ namespace OpenSim.Grid.AssetServer
XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
AssetBase asset = (AssetBase) xs.Deserialize(request); AssetBase asset = (AssetBase) xs.Deserialize(request);
MainLog.Instance.Verbose("REST", "StoreAndCommitAsset {0}", asset.FullID); m_log.Info(String.Format("[REST]: StoreAndCommitAsset {0}", asset.FullID));
m_assetProvider.CreateAsset(asset); m_assetProvider.CreateAsset(asset);
m_assetProvider.CommitAssets(); m_assetProvider.CommitAssets();

View File

@ -38,13 +38,15 @@ namespace OpenGrid.Config.GridConfigDb4o
/// </summary> /// </summary>
public class Db40ConfigPlugin: IGridConfig public class Db40ConfigPlugin: IGridConfig
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Loads and returns a configuration objeect /// Loads and returns a configuration objeect
/// </summary> /// </summary>
/// <returns>A grid configuration object</returns> /// <returns>A grid configuration object</returns>
public GridConfig GetConfigObject() public GridConfig GetConfigObject()
{ {
MainLog.Instance.Verbose("DBGRIDCONFIG", "Loading Db40Config dll"); m_log.Info("[DBGRIDCONFIG]: Loading Db40Config dll");
return new DbGridConfig(); return new DbGridConfig();
} }
} }
@ -64,24 +66,24 @@ namespace OpenGrid.Config.GridConfigDb4o
/// </summary> /// </summary>
public void LoadDefaults() public void LoadDefaults()
{ {
MainLog.Instance.Notice("DbGridConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); MainConsole.Instance.Info("DbGridConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
// About the grid options // About the grid options
this.GridOwner = MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); this.GridOwner = MainConsole.Instance.CmdPrompt("Grid owner", "OGS development team");
// Asset Options // Asset Options
this.DefaultAssetServer = MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"); this.DefaultAssetServer = MainConsole.Instance.CmdPrompt("Default asset server","http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/");
this.AssetSendKey = MainLog.Instance.CmdPrompt("Key to send to asset server","null"); this.AssetSendKey = MainConsole.Instance.CmdPrompt("Key to send to asset server","null");
this.AssetRecvKey = MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); this.AssetRecvKey = MainConsole.Instance.CmdPrompt("Key to expect from asset server","null");
// User Server Options // User Server Options
this.DefaultUserServer = MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/"); this.DefaultUserServer = MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/");
this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server","null"); this.UserSendKey = MainConsole.Instance.CmdPrompt("Key to send to user server","null");
this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server","null"); this.UserRecvKey = MainConsole.Instance.CmdPrompt("Key to expect from user server","null");
// Region Server Options // Region Server Options
this.SimSendKey = MainLog.Instance.CmdPrompt("Key to send to sims","null"); this.SimSendKey = MainConsole.Instance.CmdPrompt("Key to send to sims","null");
this.SimRecvKey = MainLog.Instance.CmdPrompt("Key to expect from sims","null"); this.SimRecvKey = MainConsole.Instance.CmdPrompt("Key to expect from sims","null");
} }
/// <summary> /// <summary>
@ -99,7 +101,7 @@ namespace OpenGrid.Config.GridConfigDb4o
// Found? // Found?
if (result.Count==1) if (result.Count==1)
{ {
MainLog.Instance.Verbose("DBGRIDCONFIG", "Found a GridConfig object in the local database, loading"); m_log.Info("[DBGRIDCONFIG]: Found a GridConfig object in the local database, loading");
foreach (DbGridConfig cfg in result) foreach (DbGridConfig cfg in result)
{ {
// Import each setting into this class // Import each setting into this class
@ -121,13 +123,13 @@ namespace OpenGrid.Config.GridConfigDb4o
} }
else else
{ {
MainLog.Instance.Verbose("DBGRIDCONFIG", "Could not find object in database, loading precompiled defaults"); m_log.Info("[DBGRIDCONFIG]: Could not find object in database, loading precompiled defaults");
// Load default settings into this class // Load default settings into this class
LoadDefaults(); LoadDefaults();
// Saves to the database file... // Saves to the database file...
MainLog.Instance.Verbose("DBGRIDCONFIG", "Writing out default settings to local database"); m_log.Info("[DBGRIDCONFIG]: Writing out default settings to local database");
db.Set(this); db.Set(this);
// Closes file locks // Closes file locks
@ -136,27 +138,27 @@ namespace OpenGrid.Config.GridConfigDb4o
} }
catch(Exception e) catch(Exception e)
{ {
MainLog.Instance.Warn("DbGridConfig.cs:InitConfig() - Exception occured"); m_log.Warn("DbGridConfig.cs:InitConfig() - Exception occured");
MainLog.Instance.Warn(e.ToString()); m_log.Warn(e.ToString());
} }
// Grid Settings // Grid Settings
MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid settings loaded:"); m_log.Info("[DBGRIDCONFIG]: Grid settings loaded:");
MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid owner: " + this.GridOwner); m_log.Info("[DBGRIDCONFIG]: Grid owner: " + this.GridOwner);
// Asset Settings // Asset Settings
MainLog.Instance.Verbose("DBGRIDCONFIG", "Default asset server: " + this.DefaultAssetServer); m_log.Info("[DBGRIDCONFIG]: Default asset server: " + this.DefaultAssetServer);
MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to asset server: " + this.AssetSendKey); m_log.Info("[DBGRIDCONFIG]: Key to send to asset server: " + this.AssetSendKey);
MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from asset server: " + this.AssetRecvKey); m_log.Info("[DBGRIDCONFIG]: Key to expect from asset server: " + this.AssetRecvKey);
// User Settings // User Settings
MainLog.Instance.Verbose("DBGRIDCONFIG", "Default user server: " + this.DefaultUserServer); m_log.Info("[DBGRIDCONFIG]: Default user server: " + this.DefaultUserServer);
MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to user server: " + this.UserSendKey); m_log.Info("[DBGRIDCONFIG]: Key to send to user server: " + this.UserSendKey);
MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from user server: " + this.UserRecvKey); m_log.Info("[DBGRIDCONFIG]: Key to expect from user server: " + this.UserRecvKey);
// Region Settings // Region Settings
MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to sims: " + this.SimSendKey); m_log.Info("[DBGRIDCONFIG]: Key to send to sims: " + this.SimSendKey);
MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from sims: " + this.SimRecvKey); m_log.Info("[DBGRIDCONFIG]: Key to expect from sims: " + this.SimRecvKey);
} }
/// <summary> /// <summary>

View File

@ -38,11 +38,12 @@ using OpenSim.Framework.Console;
using OpenSim.Framework.Data; using OpenSim.Framework.Data;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
namespace OpenSim.Grid.GridServer namespace OpenSim.Grid.GridServer
{ {
internal class GridManager internal class GridManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>(); private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>();
@ -57,10 +58,10 @@ namespace OpenSim.Grid.GridServer
/// <param name="FileName">The filename to the grid server plugin DLL</param> /// <param name="FileName">The filename to the grid server plugin DLL</param>
public void AddPlugin(string FileName) public void AddPlugin(string FileName)
{ {
MainLog.Instance.Verbose("DATA", "Attempting to load " + FileName); m_log.Info("[DATA]: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName);
MainLog.Instance.Verbose("DATA", "Found " + pluginAssembly.GetTypes().Length + " interfaces."); m_log.Info("[DATA]: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes()) foreach (Type pluginType in pluginAssembly.GetTypes())
{ {
if (!pluginType.IsAbstract) if (!pluginType.IsAbstract)
@ -74,7 +75,7 @@ namespace OpenSim.Grid.GridServer
(IGridData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); (IGridData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(); plug.Initialise();
_plugins.Add(plug.getName(), plug); _plugins.Add(plug.getName(), plug);
MainLog.Instance.Verbose("DATA", "Added IGridData Interface"); m_log.Info("[DATA]: Added IGridData Interface");
} }
typeInterface = null; typeInterface = null;
@ -88,7 +89,7 @@ namespace OpenSim.Grid.GridServer
(ILogData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); (ILogData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(); plug.Initialise();
_logplugins.Add(plug.getName(), plug); _logplugins.Add(plug.getName(), plug);
MainLog.Instance.Verbose("DATA", "Added ILogData Interface"); m_log.Info("[DATA]: Added ILogData Interface");
} }
typeInterface = null; typeInterface = null;
@ -116,7 +117,7 @@ namespace OpenSim.Grid.GridServer
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Warn("storage", "Unable to write log via " + kvp.Key); m_log.Warn("[storage]: Unable to write log via " + kvp.Key);
} }
} }
} }
@ -136,7 +137,7 @@ namespace OpenSim.Grid.GridServer
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("storage", "getRegion - " + e.Message); m_log.Warn("[storage]: getRegion - " + e.Message);
} }
} }
return null; return null;
@ -157,7 +158,7 @@ namespace OpenSim.Grid.GridServer
} }
catch catch
{ {
MainLog.Instance.Warn("storage", "Unable to find region " + handle.ToString() + " via " + kvp.Key); m_log.Warn("[storage]: Unable to find region " + handle.ToString() + " via " + kvp.Key);
} }
} }
return null; return null;
@ -179,7 +180,7 @@ namespace OpenSim.Grid.GridServer
} }
catch catch
{ {
MainLog.Instance.Warn("storage", "Unable to query regionblock via " + kvp.Key); m_log.Warn("[storage]: Unable to query regionblock via " + kvp.Key);
} }
} }
@ -245,14 +246,14 @@ namespace OpenSim.Grid.GridServer
} }
else else
{ {
MainLog.Instance.Verbose("GRID", "Region connected without a UUID, ignoring."); m_log.Info("[GRID]: Region connected without a UUID, ignoring.");
responseData["error"] = "No UUID passed to grid server - unable to connect you"; responseData["error"] = "No UUID passed to grid server - unable to connect you";
return response; return response;
} }
if (TheSim == null) // Shouldnt this be in the REST Simulator Set method? if (TheSim == null) // Shouldnt this be in the REST Simulator Set method?
{ {
MainLog.Instance.Verbose("GRID", "New region connecting"); m_log.Info("[GRID]: New region connecting");
myword = "creation"; myword = "creation";
} }
else else
@ -320,7 +321,7 @@ namespace OpenSim.Grid.GridServer
(OldSim.regionRecvKey == TheSim.regionRecvKey && (OldSim.regionRecvKey == TheSim.regionRecvKey &&
OldSim.regionSendKey == TheSim.regionSendKey)) OldSim.regionSendKey == TheSim.regionSendKey))
{ {
MainLog.Instance.Verbose("GRID", "Adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " + m_log.Info("[GRID]: Adding region " + TheSim.regionLocX + " , " + TheSim.regionLocY + " , " +
TheSim.serverURI); TheSim.serverURI);
foreach (KeyValuePair<string, IGridData> kvp in _plugins) foreach (KeyValuePair<string, IGridData> kvp in _plugins)
{ {
@ -330,17 +331,17 @@ namespace OpenSim.Grid.GridServer
switch (insertResponse) switch (insertResponse)
{ {
case DataResponse.RESPONSE_OK: case DataResponse.RESPONSE_OK:
MainLog.Instance.Verbose("grid", "New sim " + myword + " successful: " + TheSim.regionName); m_log.Info("[grid]: New sim " + myword + " successful: " + TheSim.regionName);
break; break;
case DataResponse.RESPONSE_ERROR: case DataResponse.RESPONSE_ERROR:
MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName); m_log.Warn("[storage]: New sim creation failed (Error): " + TheSim.regionName);
break; break;
case DataResponse.RESPONSE_INVALIDCREDENTIALS: case DataResponse.RESPONSE_INVALIDCREDENTIALS:
MainLog.Instance.Warn("storage", m_log.Warn("[storage]: " +
"New sim creation failed (Invalid Credentials): " + TheSim.regionName); "New sim creation failed (Invalid Credentials): " + TheSim.regionName);
break; break;
case DataResponse.RESPONSE_AUTHREQUIRED: case DataResponse.RESPONSE_AUTHREQUIRED:
MainLog.Instance.Warn("storage", m_log.Warn("[storage]: " +
"New sim creation failed (Authentication Required): " + "New sim creation failed (Authentication Required): " +
TheSim.regionName); TheSim.regionName);
break; break;
@ -348,9 +349,9 @@ namespace OpenSim.Grid.GridServer
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("storage", m_log.Warn("[storage]: " +
"Unable to add region " + TheSim.UUID.ToString() + " via " + kvp.Key); "Unable to add region " + TheSim.UUID.ToString() + " via " + kvp.Key);
MainLog.Instance.Warn("storage", e.ToString()); m_log.Warn("[storage]: " + e.ToString());
} }
@ -458,14 +459,14 @@ namespace OpenSim.Grid.GridServer
} }
else else
{ {
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); 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);
responseData["error"] = "The key required to connect to your region did not match. Please check your send and recieve keys."; responseData["error"] = "The key required to connect to your region did not match. Please check your send and recieve keys.";
return response; return response;
} }
} }
else else
{ {
MainLog.Instance.Warn("grid", "Failed to add new region " + TheSim.regionName + " at location " + TheSim.regionLocX + " " + TheSim.regionLocY + " currently occupied by " + OldSim.regionName); m_log.Warn("[grid]: Failed to add new region " + TheSim.regionName + " at location " + TheSim.regionLocX + " " + TheSim.regionLocY + " currently occupied by " + OldSim.regionName);
responseData["error"] = "Another region already exists at that location. Try another"; responseData["error"] = "Another region already exists at that location. Try another";
return response; return response;
} }
@ -496,7 +497,7 @@ namespace OpenSim.Grid.GridServer
} }
else else
{ {
MainLog.Instance.Verbose("DATA", "found " + (string) simData.regionName + " regionHandle = " + m_log.Info("[DATA]: found " + (string) simData.regionName + " regionHandle = " +
(string) requestData["region_handle"]); (string) requestData["region_handle"]);
responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString(); responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString();
responseData["sim_port"] = simData.serverPort.ToString(); responseData["sim_port"] = simData.serverPort.ToString();
@ -535,8 +536,8 @@ namespace OpenSim.Grid.GridServer
{ {
ymax = (Int32) requestData["ymax"]; ymax = (Int32) requestData["ymax"];
} }
//CFK: The second MainLog is more meaningful and either standard or fast generally occurs. //CFK: The second log is more meaningful and either standard or fast generally occurs.
//CFK: MainLog.Instance.Verbose("MAP", "World map request for range (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); //CFK: m_log.Info("[MAP]: World map request for range (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")");
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable(); Hashtable responseData = new Hashtable();
@ -575,7 +576,7 @@ namespace OpenSim.Grid.GridServer
simProfileList.Add(simProfileBlock); simProfileList.Add(simProfileBlock);
} }
MainLog.Instance.Verbose("MAP", "Fast map " + simProfileList.Count.ToString() + m_log.Info("[MAP]: Fast map " + simProfileList.Count.ToString() +
" regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")");
} }
else else
@ -610,7 +611,7 @@ namespace OpenSim.Grid.GridServer
} }
} }
} }
MainLog.Instance.Verbose("MAP", "Std map " + simProfileList.Count.ToString() + m_log.Info("[MAP]: Std map " + simProfileList.Count.ToString() +
" regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")");
} }
@ -776,7 +777,7 @@ namespace OpenSim.Grid.GridServer
try try
{ {
MainLog.Instance.Verbose("DATA", m_log.Info("[DATA]: " +
"Updating / adding via " + _plugins.Count + " storage provider(s) registered."); "Updating / adding via " + _plugins.Count + " storage provider(s) registered.");
foreach (KeyValuePair<string, IGridData> kvp in _plugins) foreach (KeyValuePair<string, IGridData> kvp in _plugins)
{ {
@ -789,13 +790,13 @@ namespace OpenSim.Grid.GridServer
(reserveData == null && authkeynode.InnerText != TheSim.regionRecvKey)) (reserveData == null && authkeynode.InnerText != TheSim.regionRecvKey))
{ {
kvp.Value.AddProfile(TheSim); kvp.Value.AddProfile(TheSim);
MainLog.Instance.Verbose("grid", "New sim added to grid (" + TheSim.regionName + ")"); m_log.Info("[grid]: New sim added to grid (" + TheSim.regionName + ")");
logToDB(TheSim.UUID.ToString(), "RestSetSimMethod", String.Empty, 5, logToDB(TheSim.UUID.ToString(), "RestSetSimMethod", String.Empty, 5,
"Region successfully updated and connected to grid."); "Region successfully updated and connected to grid.");
} }
else else
{ {
MainLog.Instance.Warn("grid", m_log.Warn("[grid]: " +
"Unable to update region (RestSetSimMethod): Incorrect reservation auth key."); "Unable to update region (RestSetSimMethod): Incorrect reservation auth key.");
// Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + "."); // Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + ".");
return "Unable to update region (RestSetSimMethod): Incorrect auth key."; return "Unable to update region (RestSetSimMethod): Incorrect auth key.";
@ -803,7 +804,7 @@ namespace OpenSim.Grid.GridServer
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("GRID", "getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + m_log.Warn("[GRID]: getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " +
e.ToString()); e.ToString());
} }
} }

View File

@ -39,6 +39,8 @@ namespace OpenSim.Grid.GridServer
/// </summary> /// </summary>
public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public GridConfig Cfg; public GridConfig Cfg;
public static OpenGrid_Main thegrid; public static OpenGrid_Main thegrid;
@ -54,11 +56,13 @@ namespace OpenSim.Grid.GridServer
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
log4net.Config.XmlConfigurator.Configure();
if (args.Length > 0) if (args.Length > 0)
{ {
if (args[0] == "-setuponly") setuponly = true; if (args[0] == "-setuponly") setuponly = true;
} }
Console.WriteLine("Starting...\n"); m_log.Info("Starting...\n");
thegrid = new OpenGrid_Main(); thegrid = new OpenGrid_Main();
thegrid.Startup(); thegrid.Startup();
@ -68,23 +72,18 @@ namespace OpenSim.Grid.GridServer
private void Work() private void Work()
{ {
m_log.Notice("Enter help for a list of commands\n"); m_console.Notice("Enter help for a list of commands\n");
while (true) while (true)
{ {
m_log.MainLogPrompt(); m_console.Prompt();
} }
} }
private OpenGrid_Main() private OpenGrid_Main()
{ {
if (!Directory.Exists(Util.logDir())) m_console = new ConsoleBase("OpenGrid", this);
{ MainConsole.Instance = m_console;
Directory.CreateDirectory(Util.logDir());
}
m_log =
new LogBase((Path.Combine(Util.logDir(), "opengrid-gridserver-console.log")), "OpenGrid", this, true);
MainLog.Instance = m_log;
} }
public void managercallback(string cmd) public void managercallback(string cmd)
@ -97,19 +96,18 @@ namespace OpenSim.Grid.GridServer
} }
} }
public void Startup() public void Startup()
{ {
Cfg = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); Cfg = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
//Yeah srsly, that's it. //Yeah srsly, that's it.
if (setuponly) Environment.Exit(0); if (setuponly) Environment.Exit(0);
m_log.Verbose("GRID", "Connecting to Storage Server"); m_log.Info("[GRID]: Connecting to Storage Server");
m_gridManager = new GridManager(); m_gridManager = new GridManager();
m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win
m_gridManager.config = Cfg; m_gridManager.config = Cfg;
m_log.Verbose("GRID", "Starting HTTP process"); m_log.Info("[GRID]: Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
//GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
@ -135,7 +133,7 @@ namespace OpenSim.Grid.GridServer
httpServer.Start(); httpServer.Start();
m_log.Verbose("GRID", "Starting sim status checker"); m_log.Info("[GRID]: Starting sim status checker");
Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates. Timer simCheckTimer = new Timer(3600000*3); // 3 Hours between updates.
simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims);
@ -186,11 +184,11 @@ namespace OpenSim.Grid.GridServer
switch (cmd) switch (cmd)
{ {
case "help": case "help":
m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)");
break; break;
case "shutdown": case "shutdown":
m_log.Close(); m_console.Close();
Environment.Exit(0); Environment.Exit(0);
break; break;
} }

View File

@ -37,6 +37,8 @@ namespace OpenSim.Grid.InventoryServer
{ {
public class GridInventoryService : InventoryServiceBase public class GridInventoryService : InventoryServiceBase
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
InventoryItemInfo itemCallBack) InventoryItemInfo itemCallBack)
{ {
@ -108,7 +110,7 @@ namespace OpenSim.Grid.InventoryServer
LLUUID userID = new LLUUID(rawUserID); LLUUID userID = new LLUUID(rawUserID);
// We get enough verbose messages later on for diagnostics // We get enough verbose messages later on for diagnostics
//MainLog.Instance.Verbose("INVENTORY", "Request for inventory for " + userID.ToString()); //m_log.Info("[INVENTORY]: Request for inventory for " + userID.ToString());
InventoryCollection invCollection = new InventoryCollection(); InventoryCollection invCollection = new InventoryCollection();
List<InventoryFolderBase> folders; List<InventoryFolderBase> folders;
@ -126,8 +128,8 @@ namespace OpenSim.Grid.InventoryServer
{ {
LLUUID userID = new LLUUID(rawUserID); LLUUID userID = new LLUUID(rawUserID);
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "Creating new set of inventory folders for " + userID.ToString()); "[INVENTORY]: Creating new set of inventory folders for " + userID.ToString());
CreateNewUserInventory(userID); CreateNewUserInventory(userID);
return true; return true;
@ -152,8 +154,8 @@ namespace OpenSim.Grid.InventoryServer
public bool AddInventoryFolder(InventoryFolderBase folder) public bool AddInventoryFolder(InventoryFolderBase folder)
{ {
// Right now, this actions act more like an update/insert combination than a simple create. // Right now, this actions act more like an update/insert combination than a simple create.
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "[INVENTORY]: " +
"Updating in " + folder.parentID.ToString() "Updating in " + folder.parentID.ToString()
+ ", folder " + folder.name); + ", folder " + folder.name);
@ -163,8 +165,8 @@ namespace OpenSim.Grid.InventoryServer
public bool MoveInventoryFolder(InventoryFolderBase folder) public bool MoveInventoryFolder(InventoryFolderBase folder)
{ {
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "[INVENTORY]: " +
"Moving folder " + folder.folderID "Moving folder " + folder.folderID
+ " to " + folder.parentID.ToString()); + " to " + folder.parentID.ToString());
@ -175,8 +177,8 @@ namespace OpenSim.Grid.InventoryServer
public bool AddInventoryItem(InventoryItemBase item) public bool AddInventoryItem(InventoryItemBase item)
{ {
// Right now, this actions act more like an update/insert combination than a simple create. // Right now, this actions act more like an update/insert combination than a simple create.
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "[INVENTORY]: " +
"Updating in " + item.parentFolderID.ToString() "Updating in " + item.parentFolderID.ToString()
+ ", item " + item.inventoryName); + ", item " + item.inventoryName);
@ -187,8 +189,8 @@ namespace OpenSim.Grid.InventoryServer
public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{ {
// extra spaces to align with other inventory messages // extra spaces to align with other inventory messages
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "[INVENTORY]: " +
"Deleting in " + item.parentFolderID.ToString() "Deleting in " + item.parentFolderID.ToString()
+ ", item " + item.inventoryName); + ", item " + item.inventoryName);

View File

@ -41,6 +41,8 @@ namespace OpenSim.Grid.InventoryServer
{ {
public class InventoryManager public class InventoryManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryData _databasePlugin; private IInventoryData _databasePlugin;
/// <summary> /// <summary>
@ -49,10 +51,10 @@ namespace OpenSim.Grid.InventoryServer
/// <param name="FileName">The filename to the inventory server plugin DLL</param> /// <param name="FileName">The filename to the inventory server plugin DLL</param>
public void AddDatabasePlugin(string FileName) public void AddDatabasePlugin(string FileName)
{ {
MainLog.Instance.Verbose(OpenInventory_Main.LogName, "Invenstorage: Attempting to load " + FileName); m_log.Info("[" + OpenInventory_Main.LogName + "]: Invenstorage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName);
MainLog.Instance.Verbose(OpenInventory_Main.LogName, m_log.Info("[" + OpenInventory_Main.LogName + "]: " +
"Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes()) foreach (Type pluginType in pluginAssembly.GetTypes())
{ {
@ -66,7 +68,7 @@ namespace OpenSim.Grid.InventoryServer
(IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(); plug.Initialise();
_databasePlugin = plug; _databasePlugin = plug;
MainLog.Instance.Verbose(OpenInventory_Main.LogName, m_log.Info("[" + OpenInventory_Main.LogName + "]: " +
"Invenstorage: Added IInventoryData Interface"); "Invenstorage: Added IInventoryData Interface");
break; break;
} }
@ -156,7 +158,7 @@ namespace OpenSim.Grid.InventoryServer
saveInventoryToStream(_inventory, fs); saveInventoryToStream(_inventory, fs);
fs.Flush(); fs.Flush();
fs.Close(); fs.Close();
MainLog.Instance.Debug(OpenInventory_Main.LogName, "Modified"); m_log.Debug("[" + OpenInventory_Main.LogName + "]: Modified");
} }
} }
@ -166,14 +168,14 @@ namespace OpenSim.Grid.InventoryServer
private byte[] GetUserInventory(LLUUID userID) private byte[] GetUserInventory(LLUUID userID)
{ {
MainLog.Instance.Notice(OpenInventory_Main.LogName, "Getting Inventory for user {0}", userID.ToString()); m_log.Info(String.Format("[" + OpenInventory_Main.LogName + "]: Getting Inventory for user {0}", userID.ToString()));
byte[] result = new byte[] {}; byte[] result = new byte[] {};
InventoryFolderBase fb = _manager._databasePlugin.getUserRootFolder(userID); InventoryFolderBase fb = _manager._databasePlugin.getUserRootFolder(userID);
if (fb == null) if (fb == null)
{ {
MainLog.Instance.Notice(OpenInventory_Main.LogName, "Inventory not found for user {0}, creating new", m_log.Info(String.Format("[" + OpenInventory_Main.LogName + "]: Inventory not found for user {0}, creating new",
userID.ToString()); userID.ToString()));
CreateDefaultInventory(userID); CreateDefaultInventory(userID);
} }

View File

@ -38,6 +38,8 @@ namespace OpenSim.Grid.InventoryServer
{ {
public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private InventoryManager m_inventoryManager; private InventoryManager m_inventoryManager;
private InventoryConfig m_config; private InventoryConfig m_config;
private GridInventoryService m_inventoryService; private GridInventoryService m_inventoryService;
@ -47,6 +49,8 @@ namespace OpenSim.Grid.InventoryServer
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
log4net.Config.XmlConfigurator.Configure();
OpenInventory_Main theServer = new OpenInventory_Main(); OpenInventory_Main theServer = new OpenInventory_Main();
theServer.Startup(); theServer.Startup();
@ -55,20 +59,20 @@ namespace OpenSim.Grid.InventoryServer
public OpenInventory_Main() public OpenInventory_Main()
{ {
m_log = new LogBase("opengrid-inventory-console.log", LogName, this, true); m_console = new ConsoleBase(LogName, this);
MainLog.Instance = m_log; MainConsole.Instance = m_console;
} }
public void Startup() public void Startup()
{ {
MainLog.Instance.Notice("Initialising inventory manager..."); m_log.Info("Initialising inventory manager...");
m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml")));
m_inventoryService = new GridInventoryService(); m_inventoryService = new GridInventoryService();
// m_inventoryManager = new InventoryManager(); // m_inventoryManager = new InventoryManager();
m_inventoryService.AddPlugin(m_config.DatabaseProvider); m_inventoryService.AddPlugin(m_config.DatabaseProvider);
MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); m_log.Info("[" + LogName + "]: Starting HTTP server ...");
BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
httpServer.AddStreamHandler( httpServer.AddStreamHandler(
new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/",
@ -98,16 +102,16 @@ namespace OpenSim.Grid.InventoryServer
// httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager));
httpServer.Start(); httpServer.Start();
MainLog.Instance.Notice(LogName, "Started HTTP server"); m_log.Info("[" + LogName + "]: Started HTTP server");
} }
private void Work() private void Work()
{ {
m_log.Notice("Enter help for a list of commands\n"); m_console.Notice("Enter help for a list of commands\n");
while (true) while (true)
{ {
m_log.MainLogPrompt(); m_console.Prompt();
} }
} }
@ -122,7 +126,7 @@ namespace OpenSim.Grid.InventoryServer
m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID);
break; break;
case "shutdown": case "shutdown":
m_log.Close(); m_console.Close();
Environment.Exit(0); Environment.Exit(0);
break; break;
} }

View File

@ -41,6 +41,8 @@ namespace OpenSim.Grid.MessagingServer
/// </summary> /// </summary>
public class OpenMessage_Main : BaseOpenSimServer, conscmd_callback public class OpenMessage_Main : BaseOpenSimServer, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private MessageServerConfig Cfg; private MessageServerConfig Cfg;
//public UserManager m_userManager; //public UserManager m_userManager;
@ -51,7 +53,9 @@ namespace OpenSim.Grid.MessagingServer
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
Console.WriteLine("Launching MessagingServer..."); log4net.Config.XmlConfigurator.Configure();
m_log.Info("Launching MessagingServer...");
OpenMessage_Main messageserver = new OpenMessage_Main(); OpenMessage_Main messageserver = new OpenMessage_Main();
@ -61,22 +65,17 @@ namespace OpenSim.Grid.MessagingServer
private OpenMessage_Main() private OpenMessage_Main()
{ {
if (!Directory.Exists(Util.logDir())) m_console = new ConsoleBase("OpenMessage", this);
{ MainConsole.Instance = m_console;
Directory.CreateDirectory(Util.logDir());
}
m_log =
new LogBase((Path.Combine(Util.logDir(), "opengrid-messagingserver-console.log")), "OpenMessage", this, true);
MainLog.Instance = m_log;
} }
private void Work() private void Work()
{ {
m_log.Notice("Enter help for a list of commands\n"); m_console.Notice("Enter help for a list of commands\n");
while (true) while (true)
{ {
m_log.MainLogPrompt(); m_console.Prompt();
} }
} }
@ -84,9 +83,7 @@ namespace OpenSim.Grid.MessagingServer
{ {
Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml")));
m_log.Info("[REGION]: Starting HTTP process");
MainLog.Instance.Verbose("REGION", "Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
//httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); //httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
@ -104,10 +101,9 @@ namespace OpenSim.Grid.MessagingServer
//new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod));
httpServer.Start(); httpServer.Start();
m_log.Status("SERVER", "Messageserver 0.4 - Startup complete"); m_log.Info("[SERVER]: Messageserver 0.4 - Startup complete");
} }
public void do_create(string what) public void do_create(string what)
{ {
switch (what) switch (what)
@ -120,7 +116,7 @@ namespace OpenSim.Grid.MessagingServer
//m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
} catch (Exception ex) } catch (Exception ex)
{ {
m_log.Error("SERVER", "Error creating user: {0}", ex.ToString()); m_console.Error("[SERVER]: Error creating user: {0}", ex.ToString());
} }
try try
@ -130,7 +126,7 @@ namespace OpenSim.Grid.MessagingServer
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); m_console.Error("[SERVER]: Error creating inventory for user: {0}", ex.ToString());
} }
// m_lastCreatedUser = userID; // m_lastCreatedUser = userID;
break; break;
@ -144,11 +140,11 @@ namespace OpenSim.Grid.MessagingServer
switch (cmd) switch (cmd)
{ {
case "help": case "help":
m_log.Notice("shutdown - shutdown the message server (USE CAUTION!)"); m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)");
break; break;
case "shutdown": case "shutdown":
m_log.Close(); m_console.Close();
Environment.Exit(0); Environment.Exit(0);
break; break;
} }

View File

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

View File

@ -26,10 +26,13 @@
* *
*/ */
/* Original code: Tedd Hansen */ /* Original code: Tedd Hansen */
namespace OpenSim.Grid.ScriptEngine.DotNetEngine namespace OpenSim.Grid.ScriptEngine.DotNetEngine
{ {
public static class Common public static class Common
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static bool debug = true; public static bool debug = true;
public static ScriptEngine mySE; public static ScriptEngine mySE;
@ -41,14 +44,14 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
public static void SendToDebug(string Message) public static void SendToDebug(string Message)
{ {
//if (Debug == true) //if (Debug == true)
mySE.Log.Verbose("ScriptEngine", "Debug: " + Message); mySE.m_log.Info("[ScriptEngine]: Debug: " + Message);
//SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
} }
public static void SendToLog(string Message) public static void SendToLog(string Message)
{ {
//if (Debug == true) //if (Debug == true)
mySE.Log.Verbose("ScriptEngine", "LOG: " + Message); mySE.m_log.Info("[ScriptEngine]: LOG: " + Message);
//SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
} }
} }

View File

@ -41,6 +41,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL
//[Serializable] //[Serializable]
public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Object never expires // Object never expires
public override Object InitializeLifetimeService() public override Object InitializeLifetimeService()
{ {
@ -87,7 +89,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL
{ {
m_LSL_Functions = LSL_Functions; m_LSL_Functions = LSL_Functions;
//MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called."); //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called.");
// Get this AppDomain's settings and display some of them. // Get this AppDomain's settings and display some of them.
AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;

View File

@ -52,6 +52,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
/// </summary> /// </summary>
public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private ASCIIEncoding enc = new ASCIIEncoding(); private ASCIIEncoding enc = new ASCIIEncoding();
private ScriptEngine m_ScriptEngine; private ScriptEngine m_ScriptEngine;
private SceneObjectPart m_host; private SceneObjectPart m_host;
@ -68,7 +70,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
m_itemID = itemID; m_itemID = itemID;
//MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
} }

View File

@ -38,17 +38,19 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
[Serializable] [Serializable]
internal class EventManager internal class EventManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private ScriptEngine myScriptEngine; private ScriptEngine myScriptEngine;
//public IScriptHost TEMP_OBJECT_ID; //public IScriptHost TEMP_OBJECT_ID;
public EventManager(ScriptEngine _ScriptEngine) public EventManager(ScriptEngine _ScriptEngine)
{ {
myScriptEngine = _ScriptEngine; myScriptEngine = _ScriptEngine;
// TODO: HOOK EVENTS UP TO SERVER! // TODO: HOOK EVENTS UP TO SERVER!
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Start"); //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Start");
// TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager
// Hook up a test event to our test form // Hook up a test event to our test form
myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); myScriptEngine.m_log.Info("[ScriptEngine]: Hooking up to server events");
myScriptEngine.World.EventManager.OnObjectGrab += touch_start; myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
myScriptEngine.World.EventManager.OnRezScript += OnRezScript; myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
@ -57,7 +59,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{ {
// Add to queue for all scripts in ObjectID object // Add to queue for all scripts in ObjectID object
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); //myScriptEngine.m_log.Info("[ScriptEngine]: EventManager Event: touch_start");
//Console.WriteLine("touch_start localID: " + localID); //Console.WriteLine("touch_start localID: " + localID);
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1});
} }

View File

@ -44,6 +44,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
[Serializable] [Serializable]
internal class EventQueueManager internal class EventQueueManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// List of threads processing event queue /// List of threads processing event queue
/// </summary> /// </summary>
@ -118,7 +120,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
} }
catch (Exception) catch (Exception)
{ {
//myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString()); //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Exception killing worker thread: " + e.ToString());
} }
} }
} }
@ -132,7 +134,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
/// </summary> /// </summary>
private void EventQueueThreadLoop() private void EventQueueThreadLoop()
{ {
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned"); //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread spawned");
try try
{ {
QueueItemStruct BlankQIS = new QueueItemStruct(); QueueItemStruct BlankQIS = new QueueItemStruct();
@ -151,7 +153,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
else else
{ {
// Something in queue, process // Something in queue, process
//myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); //myScriptEngine.m_log.Info("[ScriptEngine]: Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
// OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD
lock (queueLock) lock (queueLock)
@ -237,7 +239,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
} // try } // try
catch (ThreadAbortException) catch (ThreadAbortException)
{ {
//myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message); //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Worker thread killed: " + tae.Message);
} }
} }
@ -287,7 +289,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
public void AddToObjectQueue(uint localID, string FunctionName, object[] param) public void AddToObjectQueue(uint localID, string FunctionName, object[] param)
{ {
// Determine all scripts in Object and add to their queue // Determine all scripts in Object and add to their queue
//myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); //myScriptEngine.m_log.Info("[ScriptEngine]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
// Do we have any scripts in this object at all? If not, return // Do we have any scripts in this object at all? If not, return

View File

@ -40,6 +40,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
[Serializable] [Serializable]
public class ScriptEngine : IRegionModule public class ScriptEngine : IRegionModule
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
internal Scene World; internal Scene World;
internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
internal EventQueueManager m_EventQueueManager; // Executes events internal EventQueueManager m_EventQueueManager; // Executes events
@ -47,7 +49,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
internal AppDomainManager m_AppDomainManager; internal AppDomainManager m_AppDomainManager;
internal LSLLongCmdHandler m_LSLLongCmdHandler; internal LSLLongCmdHandler m_LSLLongCmdHandler;
private LogBase m_log;
public ScriptEngine() public ScriptEngine()
{ {
@ -55,19 +56,13 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
Common.mySE = this; Common.mySE = this;
} }
public LogBase Log public void InitializeEngine(Scene Sceneworld)
{
get { return m_log; }
}
public void InitializeEngine(Scene Sceneworld, LogBase logger)
{ {
World = Sceneworld; World = Sceneworld;
m_log = logger;
Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); m_log.Info("[ScriptEngine]: DotNet & LSL ScriptEngine initializing");
//m_logger.Status("ScriptEngine", "InitializeEngine"); //m_log.Info("[ScriptEngine]: InitializeEngine");
// Create all objects we'll be using // Create all objects we'll be using
m_EventQueueManager = new EventQueueManager(this); m_EventQueueManager = new EventQueueManager(this);
@ -90,7 +85,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
//public void StartScript(string ScriptID, IScriptHost ObjectID) //public void StartScript(string ScriptID, IScriptHost ObjectID)
//{ //{
// this.myEventManager.TEMP_OBJECT_ID = ObjectID; // this.myEventManager.TEMP_OBJECT_ID = ObjectID;
// Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); // m_log.Info("[ScriptEngine]: DEBUG FUNCTION: StartScript: " + ScriptID);
// myScriptManager.StartScript(ScriptID, ObjectID); // myScriptManager.StartScript(ScriptID, ObjectID);
//} //}
@ -98,7 +93,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
InitializeEngine(scene, MainLog.Instance); InitializeEngine(scene);
} }
public void PostInitialise() public void PostInitialise()

View File

@ -48,6 +48,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
[Serializable] [Serializable]
public class ScriptManager public class ScriptManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#region Declares #region Declares
private Thread scriptLoadUnloadThread; private Thread scriptLoadUnloadThread;
@ -312,7 +314,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
} }
catch (Exception e) catch (Exception e)
{ {
//m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString()); //m_scriptEngine.m_log.Error("[ScriptEngine]: Error compiling script: " + e.ToString());
try try
{ {
// DISPLAY ERROR INWORLD // DISPLAY ERROR INWORLD
@ -323,7 +325,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
} }
catch (Exception e2) catch (Exception e2)
{ {
m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString()); m_scriptEngine.m_log.Error("[ScriptEngine]: Error displaying error in-world: " + e2.ToString());
} }
} }
} }
@ -384,7 +386,7 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine
internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args)
{ {
// Execute a function in the script // Execute a function in the script
//m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); //m_scriptEngine.m_log.Info("[ScriptEngine]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID); LSL_BaseClass Script = m_scriptEngine.m_ScriptManager.GetScript(localID, itemID);
if (Script == null) if (Script == null)
return; return;

View File

@ -37,6 +37,8 @@ namespace OpenSim.Grid.ScriptServer
private static void Main(string[] args) private static void Main(string[] args)
{ {
log4net.Config.XmlConfigurator.Configure();
AppDomain.CurrentDomain.UnhandledException += AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

View File

@ -33,14 +33,12 @@ namespace OpenSim.Grid.ScriptServer
// Maintains connection and communication to a region // Maintains connection and communication to a region
public class RegionConnectionManager : RegionBase public class RegionConnectionManager : RegionBase
{ {
private LogBase m_log;
private ScriptServerMain m_ScriptServerMain; private ScriptServerMain m_ScriptServerMain;
private object m_Connection; private object m_Connection;
public RegionConnectionManager(ScriptServerMain scm, LogBase logger, object Connection) public RegionConnectionManager(ScriptServerMain scm, object Connection)
{ {
m_ScriptServerMain = scm; m_ScriptServerMain = scm;
m_log = logger;
m_Connection = Connection; m_Connection = Connection;
} }

View File

@ -38,13 +38,11 @@ namespace OpenSim.Grid.ScriptServer
private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>(); private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>();
private LogBase m_log;
private ScriptServerMain m_ScriptServerMain; private ScriptServerMain m_ScriptServerMain;
public RegionCommManager(ScriptServerMain scm, LogBase logger) public RegionCommManager(ScriptServerMain scm)
{ {
m_ScriptServerMain = scm; m_ScriptServerMain = scm;
m_log = logger;
} }
~RegionCommManager() ~RegionCommManager()
@ -96,9 +94,8 @@ namespace OpenSim.Grid.ScriptServer
// ~ ask scriptengines if they will accept script? // ~ ask scriptengines if they will accept script?
// - Add script to shared communication channel towards that region // - Add script to shared communication channel towards that region
// TODO: FAKING A CONNECTION // TODO: FAKING A CONNECTION
Regions.Add(new RegionConnectionManager(m_ScriptServerMain, m_log, null)); Regions.Add(new RegionConnectionManager(m_ScriptServerMain, null));
} }
} }
} }

View File

@ -35,13 +35,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
{ {
internal class ScriptEngineLoader internal class ScriptEngineLoader
{ {
private LogBase m_log; private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public ScriptEngineLoader(LogBase logger)
{
m_log = logger;
}
public ScriptServerInterfaces.ScriptEngine LoadScriptEngine(string EngineName) public ScriptServerInterfaces.ScriptEngine LoadScriptEngine(string EngineName)
{ {
@ -55,7 +49,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("ScriptEngine", m_log.Error("[ScriptEngine]: " +
"Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " +
e.StackTrace.ToString()); e.StackTrace.ToString());
} }
@ -87,7 +81,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
//} //}
//catch (Exception e) //catch (Exception e)
//{ //{
// m_log.Error("ScriptEngine", "Error loading assembly \String.Empty + FileName + "\": " + e.ToString()); // m_log.Error("[ScriptEngine]: Error loading assembly \String.Empty + FileName + "\": " + e.ToString());
//} //}
@ -104,7 +98,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
//} //}
//catch (Exception e) //catch (Exception e)
//{ //{
// m_log.Error("ScriptEngine", "Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
//} //}
ScriptServerInterfaces.ScriptEngine ret; ScriptServerInterfaces.ScriptEngine ret;
@ -114,7 +108,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
//} //}
//catch (Exception e) //catch (Exception e)
//{ //{
// m_log.Error("ScriptEngine", "Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
//} //}
return ret; return ret;

View File

@ -34,17 +34,15 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
{ {
internal class ScriptEngineManager internal class ScriptEngineManager
{ {
private LogBase m_log;
private ScriptEngineLoader ScriptEngineLoader; private ScriptEngineLoader ScriptEngineLoader;
private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>(); private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>();
private ScriptServerMain m_ScriptServerMain; private ScriptServerMain m_ScriptServerMain;
// Initialize // Initialize
public ScriptEngineManager(ScriptServerMain scm, LogBase logger) public ScriptEngineManager(ScriptServerMain scm)
{ {
m_ScriptServerMain = scm; m_ScriptServerMain = scm;
m_log = logger; ScriptEngineLoader = new ScriptEngineLoader();
ScriptEngineLoader = new ScriptEngineLoader(m_log);
} }
~ScriptEngineManager() ~ScriptEngineManager()

View File

@ -40,11 +40,12 @@ namespace OpenSim.Grid.ScriptServer
{ {
public class ScriptServerMain : BaseOpenSimServer, conscmd_callback public class ScriptServerMain : BaseOpenSimServer, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// //
// Root object. Creates objects used. // Root object. Creates objects used.
// //
private int listenPort = 8010; private int listenPort = 8010;
private readonly string m_logFilename = ("scriptserver.log");
// TEMP // TEMP
public static ScriptServerInterfaces.ScriptEngine Engine; public static ScriptServerInterfaces.ScriptEngine Engine;
@ -59,16 +60,15 @@ namespace OpenSim.Grid.ScriptServer
public ScriptServerMain() public ScriptServerMain()
{ {
m_log = CreateLog(); m_console = CreateConsole();
// Set up script engine mananger // Set up script engine mananger
ScriptEngines = new ScriptEngineManager(this, m_log); ScriptEngines = new ScriptEngineManager(this);
// Load DotNetEngine // Load DotNetEngine
Engine = ScriptEngines.LoadEngine("DotNetEngine"); Engine = ScriptEngines.LoadEngine("DotNetEngine");
IConfigSource config = null; IConfigSource config = null;
Engine.InitializeEngine(null, null, m_log, false, Engine.GetScriptManager()); Engine.InitializeEngine(null, null, false, Engine.GetScriptManager());
// Set up server // Set up server
@ -83,12 +83,12 @@ namespace OpenSim.Grid.ScriptServer
private void RPC_ReceiveCommand(int ID, string Command, object[] p) private void RPC_ReceiveCommand(int ID, string Command, object[] p)
{ {
m_log.Notice("SERVER", "Received command: '" + Command + "'"); m_log.Info("[SERVER]: Received command: '" + Command + "'");
if (p != null) if (p != null)
{ {
for (int i = 0; i < p.Length; i++) for (int i = 0; i < p.Length; i++)
{ {
m_log.Notice("SERVER", "Param " + i + ": " + p[i].ToString()); m_log.Info("[SERVER]: Param " + i + ": " + p[i].ToString());
} }
} }
@ -102,14 +102,9 @@ namespace OpenSim.Grid.ScriptServer
{ {
} }
protected LogBase CreateLog() protected ConsoleBase CreateConsole()
{ {
if (!Directory.Exists(Util.logDir())) return new ConsoleBase("ScriptServer", this);
{
Directory.CreateDirectory(Util.logDir());
}
return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "ScriptServer", this, true);
} }
} }
} }

View File

@ -35,9 +35,11 @@ namespace OpenUser.Config.UserConfigDb4o
{ {
public class Db4oConfigPlugin: IUserConfig public class Db4oConfigPlugin: IUserConfig
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public UserConfig GetConfigObject() public UserConfig GetConfigObject()
{ {
MainLog.Instance.Verbose("DBUSERCONFIG", "Loading Db40Config dll"); m_log.Info("[DBUSERCONFIG]: Loading Db40Config dll");
return ( new DbUserConfig()); return ( new DbUserConfig());
} }
} }
@ -48,13 +50,13 @@ namespace OpenUser.Config.UserConfigDb4o
public void LoadDefaults() public void LoadDefaults()
{ {
MainLog.Instance.Notice("DbUserConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); m_log.Info("DbUserConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); this.DefaultStartupMsg = m_log.CmdPrompt("Default startup message", "Welcome to OGS");
this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/"); this.GridServerURL = m_log.CmdPrompt("Grid server URL","http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/");
this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null"); this.GridSendKey = m_log.CmdPrompt("Key to send to grid server","null");
this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); this.GridRecvKey = m_log.CmdPrompt("Key to expect from grid server","null");
} }
public override void InitConfig() public override void InitConfig()
@ -65,7 +67,7 @@ namespace OpenUser.Config.UserConfigDb4o
IObjectSet result = db.Get(typeof(DbUserConfig)); IObjectSet result = db.Get(typeof(DbUserConfig));
if(result.Count==1) if(result.Count==1)
{ {
MainLog.Instance.Verbose("DBUSERCONFIG", "DbUserConfig.cs:InitConfig() - Found a UserConfig object in the local database, loading"); m_log.Info("[DBUSERCONFIG]: DbUserConfig.cs:InitConfig() - Found a UserConfig object in the local database, loading");
foreach (DbUserConfig cfg in result) foreach (DbUserConfig cfg in result)
{ {
this.GridServerURL=cfg.GridServerURL; this.GridServerURL=cfg.GridServerURL;
@ -76,24 +78,24 @@ namespace OpenUser.Config.UserConfigDb4o
} }
else else
{ {
MainLog.Instance.Verbose("DBUSERCONFIG", "DbUserConfig.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); m_log.Info("[DBUSERCONFIG]: DbUserConfig.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
LoadDefaults(); LoadDefaults();
MainLog.Instance.Verbose("DBUSERCONFIG", "Writing out default settings to local database"); m_log.Info("[DBUSERCONFIG]: Writing out default settings to local database");
db.Set(this); db.Set(this);
db.Close(); db.Close();
} }
} }
catch(Exception e) catch(Exception e)
{ {
MainLog.Instance.Warn("DbUserConfig.cs:InitConfig() - Exception occured"); m_log.Warn("DbUserConfig.cs:InitConfig() - Exception occured");
MainLog.Instance.Warn(e.ToString()); m_log.Warn(e.ToString());
} }
MainLog.Instance.Verbose("DBUSERCONFIG", "User settings loaded:"); m_log.Info("[DBUSERCONFIG]: User settings loaded:");
MainLog.Instance.Verbose("DBUSERCONFIG", "Default startup message: " + this.DefaultStartupMsg); m_log.Info("[DBUSERCONFIG]: Default startup message: " + this.DefaultStartupMsg);
MainLog.Instance.Verbose("DBUSERCONFIG", "Grid server URL: " + this.GridServerURL); m_log.Info("[DBUSERCONFIG]: Grid server URL: " + this.GridServerURL);
MainLog.Instance.Verbose("DBUSERCONFIG", "Key to send to grid: " + this.GridSendKey); m_log.Info("[DBUSERCONFIG]: Key to send to grid: " + this.GridSendKey);
MainLog.Instance.Verbose("DBUSERCONFIG", "Key to expect from grid: " + this.GridRecvKey); m_log.Info("[DBUSERCONFIG]: Key to expect from grid: " + this.GridRecvKey);
} }
public void Shutdown() public void Shutdown()

View File

@ -42,6 +42,8 @@ namespace OpenSim.Grid.UserServer
/// </summary> /// </summary>
public class OpenUser_Main : BaseOpenSimServer, conscmd_callback public class OpenUser_Main : BaseOpenSimServer, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private UserConfig Cfg; private UserConfig Cfg;
public UserManager m_userManager; public UserManager m_userManager;
@ -53,7 +55,9 @@ namespace OpenSim.Grid.UserServer
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
Console.WriteLine("Launching UserServer..."); log4net.Config.XmlConfigurator.Configure();
m_log.Info("Launching UserServer...");
OpenUser_Main userserver = new OpenUser_Main(); OpenUser_Main userserver = new OpenUser_Main();
@ -63,22 +67,17 @@ namespace OpenSim.Grid.UserServer
private OpenUser_Main() private OpenUser_Main()
{ {
if (!Directory.Exists(Util.logDir())) m_console = new ConsoleBase("OpenUser", this);
{ MainConsole.Instance = m_console;
Directory.CreateDirectory(Util.logDir());
}
m_log =
new LogBase((Path.Combine(Util.logDir(), "opengrid-userserver-console.log")), "OpenUser", this, true);
MainLog.Instance = m_log;
} }
private void Work() private void Work()
{ {
m_log.Notice("Enter help for a list of commands\n"); m_console.Notice("Enter help for a list of commands\n");
while (true) while (true)
{ {
m_log.MainLogPrompt(); m_console.Prompt();
} }
} }
@ -88,7 +87,7 @@ namespace OpenSim.Grid.UserServer
StatsManager.StartCollectingUserStats(); StatsManager.StartCollectingUserStats();
MainLog.Instance.Verbose("REGION", "Establishing data connection"); m_log.Info("[REGION]: Establishing data connection");
m_userManager = new UserManager(); m_userManager = new UserManager();
m_userManager._config = Cfg; m_userManager._config = Cfg;
m_userManager.AddPlugin(Cfg.DatabaseProvider); m_userManager.AddPlugin(Cfg.DatabaseProvider);
@ -96,11 +95,11 @@ namespace OpenSim.Grid.UserServer
m_loginService = new UserLoginService( m_loginService = new UserLoginService(
m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
m_messagesService = new MessageServersConnector(MainLog.Instance); m_messagesService = new MessageServersConnector();
m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation;
MainLog.Instance.Verbose("REGION", "Starting HTTP process"); m_log.Info("[REGION]: Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
@ -128,10 +127,9 @@ namespace OpenSim.Grid.UserServer
new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod));
httpServer.Start(); httpServer.Start();
m_log.Status("SERVER", "Userserver 0.4 - Startup complete"); m_log.Info("[SERVER]: Userserver 0.4 - Startup complete");
} }
public void do_create(string what) public void do_create(string what)
{ {
switch (what) switch (what)
@ -143,11 +141,11 @@ namespace OpenSim.Grid.UserServer
uint regX = 1000; uint regX = 1000;
uint regY = 1000; uint regY = 1000;
tempfirstname = m_log.CmdPrompt("First name"); tempfirstname = m_console.CmdPrompt("First name");
templastname = m_log.CmdPrompt("Last name"); templastname = m_console.CmdPrompt("Last name");
tempMD5Passwd = m_log.PasswdPrompt("Password"); tempMD5Passwd = m_console.PasswdPrompt("Password");
regX = Convert.ToUInt32(m_log.CmdPrompt("Start Region X")); regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X"));
regY = Convert.ToUInt32(m_log.CmdPrompt("Start Region Y")); regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y"));
tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty);
@ -158,7 +156,7 @@ namespace OpenSim.Grid.UserServer
m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
} catch (Exception ex) } catch (Exception ex)
{ {
m_log.Error("SERVER", "Error creating user: {0}", ex.ToString()); m_log.Error(String.Format("[SERVER]: Error creating user: {0}", ex.ToString()));
} }
try try
@ -168,7 +166,7 @@ namespace OpenSim.Grid.UserServer
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("SERVER", "Error creating inventory for user: {0}", ex.ToString()); m_log.Error(String.Format("[SERVER]: Error creating inventory for user: {0}", ex.ToString()));
} }
m_lastCreatedUser = userID; m_lastCreatedUser = userID;
break; break;
@ -182,9 +180,9 @@ namespace OpenSim.Grid.UserServer
switch (cmd) switch (cmd)
{ {
case "help": case "help":
m_log.Notice("create user - create a new user"); m_console.Notice("create user - create a new user");
m_log.Notice("stats - statistical information for this server"); m_console.Notice("stats - statistical information for this server");
m_log.Notice("shutdown - shutdown the grid (USE CAUTION!)"); m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)");
break; break;
case "create": case "create":
@ -193,12 +191,12 @@ namespace OpenSim.Grid.UserServer
case "shutdown": case "shutdown":
m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation;
m_log.Close(); m_console.Close();
Environment.Exit(0); Environment.Exit(0);
break; break;
case "stats": case "stats":
MainLog.Instance.Notice("STATS", Environment.NewLine + StatsManager.UserStats.Report()); m_console.Notice(StatsManager.UserStats.Report());
break; break;
case "test-inventory": case "test-inventory":
@ -218,8 +216,9 @@ namespace OpenSim.Grid.UserServer
public void TestResponse(List<InventoryFolderBase> resp) public void TestResponse(List<InventoryFolderBase> resp)
{ {
Console.WriteLine("response got"); m_console.Notice("response got");
} }
public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position) public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position)
{ {
m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, Position); m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, Position);

View File

@ -39,15 +39,14 @@ using OpenSim.Framework.Servers;
namespace OpenSim.Grid.UserServer namespace OpenSim.Grid.UserServer
{ {
public class MessageServersConnector public class MessageServersConnector
{ {
private LogBase m_log; private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public Dictionary<string, MessageServerInfo> MessageServers; public Dictionary<string, MessageServerInfo> MessageServers;
public MessageServersConnector(LogBase log) public MessageServersConnector()
{ {
m_log=log;
MessageServers = new Dictionary<string, MessageServerInfo>(); MessageServers = new Dictionary<string, MessageServerInfo>();
} }
@ -65,7 +64,7 @@ namespace OpenSim.Grid.UserServer
{ {
if (!MessageServers.ContainsKey(URI)) if (!MessageServers.ContainsKey(URI))
{ {
m_log.Warn("MSGSERVER", "Got addResponsibleRegion Request for a MessageServer that isn't registered"); m_log.Warn("[MSGSERVER]: Got addResponsibleRegion Request for a MessageServer that isn't registered");
} }
else else
{ {
@ -78,7 +77,7 @@ namespace OpenSim.Grid.UserServer
{ {
if (!MessageServers.ContainsKey(URI)) if (!MessageServers.ContainsKey(URI))
{ {
m_log.Warn("MSGSERVER", "Got RemoveResponsibleRegion Request for a MessageServer that isn't registered"); m_log.Warn("[MSGSERVER]: Got RemoveResponsibleRegion Request for a MessageServer that isn't registered");
} }
else else
{ {
@ -175,10 +174,7 @@ namespace OpenSim.Grid.UserServer
XmlRpcRequest GridReq = new XmlRpcRequest("login_to_simulator", SendParams); XmlRpcRequest GridReq = new XmlRpcRequest("login_to_simulator", SendParams);
XmlRpcResponse GridResp = GridReq.Send(serv.URI, 6000); XmlRpcResponse GridResp = GridReq.Send(serv.URI, 6000);
m_log.Verbose("LOGIN","Notified : " + serv.URI + " about user login"); m_log.Info("[LOGIN]: Notified : " + serv.URI + " about user login");
} }
} }
} }

View File

@ -46,9 +46,10 @@ namespace OpenSim.Grid.UserServer
{ {
public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position); public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position);
public class UserLoginService : LoginService public class UserLoginService : LoginService
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public event UserLoggedInAtLocation OnUserLoggedInAtLocation; public event UserLoggedInAtLocation OnUserLoggedInAtLocation;
public UserConfig m_config; public UserConfig m_config;
@ -70,7 +71,7 @@ namespace OpenSim.Grid.UserServer
{ {
bool tryDefault = false; bool tryDefault = false;
//CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one. //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one.
//CFK: MainLog.Instance.Verbose("LOGIN", "Load information from the gridserver"); //CFK: m_log.Info("[LOGIN]: Load information from the gridserver");
RegionProfileData SimInfo = new RegionProfileData(); RegionProfileData SimInfo = new RegionProfileData();
try try
{ {
@ -80,7 +81,7 @@ namespace OpenSim.Grid.UserServer
// Customise the response // Customise the response
//CFK: This is redundant and the next message should always appear. //CFK: This is redundant and the next message should always appear.
//CFK: MainLog.Instance.Verbose("LOGIN", "Home Location"); //CFK: m_log.Info("[LOGIN]: Home Location");
response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" +
(SimInfo.regionLocY*256).ToString() + "], " + (SimInfo.regionLocY*256).ToString() + "], " +
"'position':[r" + theUser.homeLocation.X.ToString() + ",r" + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@ -91,7 +92,7 @@ namespace OpenSim.Grid.UserServer
// Destination // Destination
//CFK: The "Notifying" message always seems to appear, so subsume the data from this message into //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into
//CFK: the next one for X & Y and comment this one. //CFK: the next one for X & Y and comment this one.
//CFK: MainLog.Instance.Verbose("LOGIN", "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + //CFK: m_log.Info("[LOGIN]: CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX +
//CFK: "; Region Y: " + SimInfo.regionLocY); //CFK: "; Region Y: " + SimInfo.regionLocY);
response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
response.SimPort = (uint) SimInfo.serverPort; response.SimPort = (uint) SimInfo.serverPort;
@ -105,7 +106,7 @@ namespace OpenSim.Grid.UserServer
// Notify the target of an incoming user // Notify the target of an incoming user
//CFK: The "Notifying" message always seems to appear, so subsume the data from this message into //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into
//CFK: the next one for X & Y and comment this one. //CFK: the next one for X & Y and comment this one.
//CFK: MainLog.Instance.Verbose("LOGIN", SimInfo.regionName + " (" + SimInfo.serverURI + ") " + //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " +
//CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY);
// Prepare notification // Prepare notification
@ -128,7 +129,7 @@ namespace OpenSim.Grid.UserServer
theUser.currentAgent.currentRegion = SimInfo.UUID; theUser.currentAgent.currentRegion = SimInfo.UUID;
theUser.currentAgent.currentHandle = SimInfo.regionHandle; theUser.currentAgent.currentHandle = SimInfo.regionHandle;
MainLog.Instance.Verbose("LOGIN", SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + m_log.Info("[LOGIN]: " + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " +
SimInfo.regionLocX + "," + SimInfo.regionLocY); SimInfo.regionLocX + "," + SimInfo.regionLocY);
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
@ -145,9 +146,8 @@ namespace OpenSim.Grid.UserServer
ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256); ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256);
MainLog.Instance.Warn( m_log.Warn(
"LOGIN", "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString());
"Home region not available: sending to default " + defaultHandle.ToString());
SimInfo = new RegionProfileData(); SimInfo = new RegionProfileData();
try try
@ -157,7 +157,7 @@ namespace OpenSim.Grid.UserServer
m_config.GridSendKey, m_config.GridRecvKey); m_config.GridSendKey, m_config.GridRecvKey);
// Customise the response // Customise the response
MainLog.Instance.Verbose("LOGIN", "Home Location"); m_log.Info("[LOGIN]: Home Location");
response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" +
(SimInfo.regionLocY*256).ToString() + "], " + (SimInfo.regionLocY*256).ToString() + "], " +
"'position':[r" + theUser.homeLocation.X.ToString() + ",r" + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@ -166,7 +166,7 @@ namespace OpenSim.Grid.UserServer
theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
// Destination // Destination
MainLog.Instance.Verbose("LOGIN", m_log.Info("[LOGIN]: " +
"CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " +
SimInfo.regionLocY); SimInfo.regionLocY);
response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
@ -179,7 +179,7 @@ namespace OpenSim.Grid.UserServer
response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/";
// Notify the target of an incoming user // Notify the target of an incoming user
MainLog.Instance.Verbose("LOGIN", "Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")");
// Update agent with target sim // Update agent with target sim
theUser.currentAgent.currentRegion = SimInfo.UUID; theUser.currentAgent.currentRegion = SimInfo.UUID;
@ -201,7 +201,7 @@ namespace OpenSim.Grid.UserServer
ArrayList SendParams = new ArrayList(); ArrayList SendParams = new ArrayList();
SendParams.Add(SimParams); SendParams.Add(SimParams);
MainLog.Instance.Verbose("LOGIN", "Informing region at " + SimInfo.httpServerURI); m_log.Info("[LOGIN]: Informing region at " + SimInfo.httpServerURI);
// Send // Send
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
@ -213,8 +213,8 @@ namespace OpenSim.Grid.UserServer
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("LOGIN", "Default region also not available"); m_log.Warn("[LOGIN]: Default region also not available");
MainLog.Instance.Warn("LOGIN", e.ToString()); m_log.Warn("[LOGIN]: " + e.ToString());
} }
} }
} }
@ -230,8 +230,8 @@ namespace OpenSim.Grid.UserServer
// which does. // which does.
if (null == folders | folders.Count == 0) if (null == folders | folders.Count == 0)
{ {
MainLog.Instance.Warn( m_log.Warn(
"LOGIN", "[LOGIN]: " +
"A root inventory folder for user ID " + userID + " was not found. A new set" "A root inventory folder for user ID " + userID + " was not found. A new set"
+ " of empty inventory folders is being created."); + " of empty inventory folders is being created.");
@ -269,7 +269,7 @@ namespace OpenSim.Grid.UserServer
} }
else else
{ {
MainLog.Instance.Warn("LOGIN", "The root inventory folder could still not be retrieved" + m_log.Warn("[LOGIN]: The root inventory folder could still not be retrieved" +
" for user ID " + userID); " for user ID " + userID);
AgentInventory userInventory = new AgentInventory(); AgentInventory userInventory = new AgentInventory();

View File

@ -39,6 +39,8 @@ namespace OpenSim.Grid.UserServer
{ {
public class UserManager : UserManagerBase public class UserManager : UserManagerBase
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Deletes an active agent session /// Deletes an active agent session
/// </summary> /// </summary>
@ -106,6 +108,7 @@ namespace OpenSim.Grid.UserServer
return response; return response;
} }
/// <summary> /// <summary>
/// Converts a user profile to an XML element which can be returned /// Converts a user profile to an XML element which can be returned
/// </summary> /// </summary>
@ -202,7 +205,6 @@ namespace OpenSim.Grid.UserServer
responseData["returnString"] = returnString; responseData["returnString"] = returnString;
response.Value = responseData; response.Value = responseData;
return response; return response;
} }
public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request)
@ -212,8 +214,6 @@ namespace OpenSim.Grid.UserServer
Hashtable responseData = new Hashtable(); Hashtable responseData = new Hashtable();
string returnString = "FALSE"; string returnString = "FALSE";
if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms"))
{ {
UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); 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
List<FriendListItem> returndata = new List<FriendListItem>(); List<FriendListItem> returndata = new List<FriendListItem>();
if (requestData.Contains("ownerID")) if (requestData.Contains("ownerID"))
{ {
returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"])); returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"]));
@ -309,7 +307,6 @@ namespace OpenSim.Grid.UserServer
return CreateUnknownUserErrorResponse(); return CreateUnknownUserErrorResponse();
} }
return ProfileToXmlRPCResponse(userProfile); return ProfileToXmlRPCResponse(userProfile);
} }
@ -318,7 +315,6 @@ namespace OpenSim.Grid.UserServer
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0]; Hashtable requestData = (Hashtable)request.Params[0];
UserProfileData userProfile; UserProfileData userProfile;
if (requestData.Contains("avatar_uuid")) if (requestData.Contains("avatar_uuid"))
@ -336,17 +332,15 @@ namespace OpenSim.Grid.UserServer
} }
catch (FormatException) catch (FormatException)
{ {
OpenSim.Framework.Console.MainLog.Instance.Warn("LOGOUT", "Error in Logout XMLRPC Params"); m_log.Warn("[LOGOUT]: Error in Logout XMLRPC Params");
return response; return response;
} }
} }
else else
{ {
return CreateUnknownUserErrorResponse(); return CreateUnknownUserErrorResponse();
} }
return response; return response;
} }

View File

@ -35,17 +35,20 @@ namespace OpenSim
{ {
public class Application public class Application
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static string iniFilePath = ""; public static string iniFilePath = "";
//could move our main function into OpenSimMain and kill this class //could move our main function into OpenSimMain and kill this class
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
log4net.Config.XmlConfigurator.Configure();
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Console.WriteLine("OpenSim " + VersionInfo.Version + "\n"); Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
Console.Write("Performing compatibility checks... "); Console.Write("Performing compatibility checks... ");
string supported = String.Empty; string supported = String.Empty;
if (Util.IsEnvironmentSupported(ref supported)) if (Util.IsEnvironmentSupported(ref supported))
@ -76,10 +79,9 @@ namespace OpenSim
sim.StartUp(); sim.StartUp();
while (true) while (true)
{ {
MainLog.Instance.MainLogPrompt(); MainConsole.Instance.Prompt();
} }
} }
@ -112,7 +114,7 @@ namespace OpenSim
// Do we not always want to see exception messages? // Do we not always want to see exception messages?
// if (e.IsTerminating) // if (e.IsTerminating)
MainLog.Instance.Error("APPLICATION", msg); MainConsole.Instance.Error("[APPLICATION]: " + msg);
// Try to post errormessage to an URL // Try to post errormessage to an URL
try try
@ -131,6 +133,5 @@ namespace OpenSim
_IsHandlingException=false; _IsHandlingException=false;
} }
} }
} }

View File

@ -55,6 +55,8 @@ namespace OpenSim
public class OpenSimMain : RegionApplicationBase, conscmd_callback public class OpenSimMain : RegionApplicationBase, conscmd_callback
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml"; private const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml";
public string m_physicsEngine; public string m_physicsEngine;
@ -77,7 +79,6 @@ namespace OpenSim
private bool m_verbose; private bool m_verbose;
private bool m_physicalPrim; private bool m_physicalPrim;
private readonly string m_logFilename = "region-console.log";
private bool m_permissions = false; private bool m_permissions = false;
private bool m_standaloneAuthenticate = false; private bool m_standaloneAuthenticate = false;
@ -146,9 +147,7 @@ namespace OpenSim
{ {
// no default config files, so set default values, and save it // no default config files, so set default values, and save it
m_config.Merge(DefaultConfig()); m_config.Merge(DefaultConfig());
m_config.Merge(configSource); m_config.Merge(configSource);
m_config.Save(Application.iniFilePath); m_config.Save(Application.iniFilePath);
} }
} }
@ -233,6 +232,8 @@ namespace OpenSim
m_sandbox = !startupConfig.GetBoolean("gridmode", false); m_sandbox = !startupConfig.GetBoolean("gridmode", false);
m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher");
// TODO: since log4net changes, verbose flag doesn't do anything
m_verbose = startupConfig.GetBoolean("verbose", true); m_verbose = startupConfig.GetBoolean("verbose", true);
m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
@ -280,7 +281,6 @@ namespace OpenSim
//if (!m_sandbox) //if (!m_sandbox)
//m_SendChildAgentTaskData = false; //m_SendChildAgentTaskData = false;
m_networkServersInfo.loadFromConfiguration(m_config); m_networkServersInfo.loadFromConfiguration(m_config);
} }
@ -293,16 +293,8 @@ namespace OpenSim
// Called from app startup (OpenSim.Application) // Called from app startup (OpenSim.Application)
// //
m_console = CreateConsole();
// Create log directory if it doesn't exist MainConsole.Instance = m_console;
if (!Directory.Exists(Util.logDir()))
{
Directory.CreateDirectory(Util.logDir());
}
// Create a log instance
m_log = CreateLog();
MainLog.Instance = m_log;
StatsManager.StartCollectingSimExtraStats(); StatsManager.StartCollectingSimExtraStats();
@ -311,7 +303,6 @@ namespace OpenSim
// This base will call abstract Initialize // This base will call abstract Initialize
base.StartUp(); base.StartUp();
// StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false) // StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false)
if (m_sandbox) if (m_sandbox)
{ {
@ -357,10 +348,10 @@ namespace OpenSim
} }
// Create a ModuleLoader instance // Create a ModuleLoader instance
m_moduleLoader = new ModuleLoader(m_log, m_config); m_moduleLoader = new ModuleLoader(m_config);
ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/Startup"); ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/Startup");
m_log.Verbose("PLUGINS", "Loading {0} OpenSim application plugins", nodes.Count); m_log.Info(String.Format("[PLUGINS]: Loading {0} OpenSim application plugins", nodes.Count));
foreach (TypeExtensionNode node in nodes) foreach (TypeExtensionNode node in nodes)
{ {
@ -383,7 +374,7 @@ namespace OpenSim
} }
else else
{ {
m_log.Verbose("STARTUP", "No startup command script specified. Moving on..."); m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
} }
// Start timer script (run a script every xx seconds) // Start timer script (run a script every xx seconds)
@ -396,10 +387,7 @@ namespace OpenSim
} }
// We are done with startup // We are done with startup
m_log.Status("STARTUP", m_log.Info("[STARTUP]: Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
"Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
// When we return now we will be in a wait for input command loop.
} }
protected override void Initialize() protected override void Initialize()
@ -433,8 +421,9 @@ namespace OpenSim
assetServer = sqlAssetServer; assetServer = sqlAssetServer;
} }
m_assetCache = new AssetCache(assetServer, m_log); m_assetCache = new AssetCache(assetServer);
// m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); // m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
m_sceneManager.OnRestartSim += handleRestartRegion; m_sceneManager.OnRestartSim += handleRestartRegion;
} }
@ -448,23 +437,23 @@ namespace OpenSim
UDPServer udpServer; UDPServer udpServer;
Scene scene = SetupScene(regionInfo, out udpServer, m_permissions); Scene scene = SetupScene(regionInfo, out udpServer, m_permissions);
m_log.Verbose("MODULES", "Loading Region's modules"); m_log.Info("[MODULES]: Loading Region's modules");
m_moduleLoader.PickupModules(scene, "."); m_moduleLoader.PickupModules(scene, ".");
//m_moduleLoader.PickupModules(scene, "ScriptEngines"); //m_moduleLoader.PickupModules(scene, "ScriptEngines");
//m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", m_scriptEngine), scene); //m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", m_scriptEngine), scene);
m_log.Verbose("MODULES", "Loading scripting engine modules"); m_log.Info("[MODULES]: Loading scripting engine modules");
foreach (string module in m_scriptEngine.Split(',')) foreach (string module in m_scriptEngine.Split(','))
{ {
string mod = module.Trim(" \t".ToCharArray()); // Clean up name string mod = module.Trim(" \t".ToCharArray()); // Clean up name
m_log.Verbose("MODULES", "Loading scripting engine: " + mod); m_log.Info("[MODULES]: Loading scripting engine: " + mod);
try try
{ {
m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", mod), scene); m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", mod), scene);
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("MODULES", "Failed to load script engine: " + ex.ToString()); m_log.Error("[MODULES]: Failed to load script engine: " + ex.ToString());
} }
} }
@ -503,8 +492,7 @@ namespace OpenSim
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
if (m_SendChildAgentTaskData) if (m_SendChildAgentTaskData)
{ {
m_log.Error("WARNING", m_log.Error("[WARNING]: Send Child Agent Task Updates is enabled. This is for testing only.");
"Send Child Agent Task Updates is enabled. This is for testing only.");
//Thread.Sleep(12000); //Thread.Sleep(12000);
} }
return return
@ -516,7 +504,7 @@ namespace OpenSim
public void handleRestartRegion(RegionInfo whichRegion) public void handleRestartRegion(RegionInfo whichRegion)
{ {
m_log.Error("MAIN", "Got restart signal from SceneManager"); m_log.Error("[MAIN]: Got restart signal from SceneManager");
// Shutting down the UDP server // Shutting down the UDP server
bool foundUDPServer = false; bool foundUDPServer = false;
int UDPServerElement = 0; int UDPServerElement = 0;
@ -557,14 +545,9 @@ namespace OpenSim
//m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle); //m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle);
} }
protected override LogBase CreateLog() protected override ConsoleBase CreateConsole()
{ {
if (!Directory.Exists(Util.logDir())) return new ConsoleBase("Region", this);
{
Directory.CreateDirectory(Util.logDir());
}
return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "Region", this, m_verbose);
} }
# region Setup methods # region Setup methods
@ -609,15 +592,15 @@ namespace OpenSim
RunCommandScript(m_shutdownCommandsFile); RunCommandScript(m_shutdownCommandsFile);
} }
m_log.Verbose("SHUTDOWN", "Closing all threads"); m_log.Info("[SHUTDOWN]: Closing all threads");
m_log.Verbose("SHUTDOWN", "Killing listener thread"); m_log.Info("[SHUTDOWN]: Killing listener thread");
m_log.Verbose("SHUTDOWN", "Killing clients"); m_log.Info("[SHUTDOWN]: Killing clients");
// TODO: implement this // TODO: implement this
m_log.Verbose("SHUTDOWN", "Closing console and terminating"); m_log.Info("[SHUTDOWN]: Closing console and terminating");
m_sceneManager.Close(); m_sceneManager.Close();
m_log.Close(); m_console.Close();
Environment.Exit(0); Environment.Exit(0);
} }
@ -637,7 +620,7 @@ namespace OpenSim
/// <param name="fileName"></param> /// <param name="fileName"></param>
private void RunCommandScript(string fileName) private void RunCommandScript(string fileName)
{ {
m_log.Verbose("COMMANDFILE", "Running " + fileName); m_log.Info("[COMMANDFILE]: Running " + fileName);
if (File.Exists(fileName)) if (File.Exists(fileName))
{ {
StreamReader readFile = File.OpenText(fileName); StreamReader readFile = File.OpenText(fileName);
@ -646,14 +629,14 @@ namespace OpenSim
{ {
if (currentCommand != String.Empty) if (currentCommand != String.Empty)
{ {
m_log.Verbose("COMMANDFILE", "Running '" + currentCommand + "'"); m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
m_log.MainLogRunCommand(currentCommand); m_console.RunCommand(currentCommand);
} }
} }
} }
else else
{ {
m_log.Error("COMMANDFILE", "Command script missing. Can not run commands"); m_log.Error("[COMMANDFILE]: Command script missing. Can not run commands");
} }
} }
@ -673,7 +656,7 @@ namespace OpenSim
break; break;
case "force-update": case "force-update":
Console.WriteLine("Updating all clients"); m_console.Notice("Updating all clients");
m_sceneManager.ForceCurrentSceneClientUpdate(); m_sceneManager.ForceCurrentSceneClientUpdate();
break; break;
@ -692,36 +675,36 @@ namespace OpenSim
break; break;
case "help": case "help":
m_log.Notice("alert - send alert to a designated user or all users."); m_console.Notice("alert - send alert to a designated user or all users.");
m_log.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
m_log.Notice(" alert general [Message] - send an alert to all users."); m_console.Notice(" alert general [Message] - send an alert to all users.");
m_log.Notice("backup - trigger a simulator backup"); m_console.Notice("backup - trigger a simulator backup");
m_log.Notice("create user - adds a new user"); m_console.Notice("create user - adds a new user");
m_log.Notice("change-region [name] - sets the region that many of these commands affect."); m_console.Notice("change-region [name] - sets the region that many of these commands affect.");
m_log.Notice("command-script [filename] - Execute command in a file."); m_console.Notice("command-script [filename] - Execute command in a file.");
m_log.Notice("debug - debugging commands"); m_console.Notice("debug - debugging commands");
m_log.Notice(" packet 0..255 - print incoming/outgoing packets (0=off)"); m_console.Notice(" packet 0..255 - print incoming/outgoing packets (0=off)");
m_log.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
m_log.Notice("export-map [filename] - save image of world map"); m_console.Notice("export-map [filename] - save image of world map");
m_log.Notice("force-update - force an update of prims in the scene"); m_console.Notice("force-update - force an update of prims in the scene");
m_log.Notice("load-xml [filename] - load prims from XML"); m_console.Notice("load-xml [filename] - load prims from XML");
m_log.Notice("load-xml2 [filename] - load prims from XML using version 2 format"); m_console.Notice("load-xml2 [filename] - load prims from XML using version 2 format");
m_log.Notice("permissions [true/false] - turn on/off permissions on the scene"); m_console.Notice("permissions [true/false] - turn on/off permissions on the scene");
m_log.Notice("quit - equivalent to shutdown."); m_console.Notice("quit - equivalent to shutdown.");
m_log.Notice("restart - disconnects all clients and restarts the sims in the instance."); m_console.Notice("restart - disconnects all clients and restarts the sims in the instance.");
m_log.Notice("remove-region [name] - remove a region"); m_console.Notice("remove-region [name] - remove a region");
m_log.Notice("save-xml [filename] - save prims to XML"); m_console.Notice("save-xml [filename] - save prims to XML");
m_log.Notice("save-xml2 [filename] - save prims to XML using version 2 format"); m_console.Notice("save-xml2 [filename] - save prims to XML using version 2 format");
m_log.Notice("script - manually trigger scripts? or script commands?"); m_console.Notice("script - manually trigger scripts? or script commands?");
m_log.Notice("set-time [x] - set the current scene time phase"); m_console.Notice("set-time [x] - set the current scene time phase");
m_log.Notice("show users - show info about connected users."); m_console.Notice("show users - show info about connected users.");
m_log.Notice("show modules - shows info aboutloaded modules."); m_console.Notice("show modules - shows info aboutloaded modules.");
m_log.Notice("show stats - statistical information for this server not displayed in the client"); m_console.Notice("show stats - statistical information for this server not displayed in the client");
m_log.Notice("shutdown - disconnect all clients and shutdown."); m_console.Notice("shutdown - disconnect all clients and shutdown.");
m_log.Notice("config set section field value - set a config value"); m_console.Notice("config set section field value - set a config value");
m_log.Notice("config get section field - get a config value"); m_console.Notice("config get section field - get a config value");
m_log.Notice("config save - save OpenSim.ini"); m_console.Notice("config save - save OpenSim.ini");
m_log.Notice("terrain help - show help for terrain commands."); m_console.Notice("terrain help - show help for terrain commands.");
break; break;
case "save-xml": case "save-xml":
@ -757,7 +740,7 @@ namespace OpenSim
{ {
loadOffset.Z = (float) Convert.ToDecimal(cmdparams[4]); loadOffset.Z = (float) Convert.ToDecimal(cmdparams[4]);
} }
m_log.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," + m_console.Error("loadOffsets <X,Y,Z> = <" + loadOffset.X + "," + loadOffset.Y + "," +
loadOffset.Z + ">"); loadOffset.Z + ">");
} }
} }
@ -796,7 +779,7 @@ namespace OpenSim
if (!m_sceneManager.RunTerrainCmdOnCurrentScene(cmdparams, ref result)) if (!m_sceneManager.RunTerrainCmdOnCurrentScene(cmdparams, ref result))
{ {
m_log.Error(result); m_console.Error(result);
} }
break; break;
@ -867,19 +850,17 @@ namespace OpenSim
if (!m_sceneManager.TrySetCurrentScene(regionName)) if (!m_sceneManager.TrySetCurrentScene(regionName))
{ {
m_log.Error("Couldn't set current region to: " + regionName); m_console.Error("Couldn't set current region to: " + regionName);
} }
} }
if (m_sceneManager.CurrentScene == null) if (m_sceneManager.CurrentScene == null)
{ {
m_log.Notice("CONSOLE", m_console.Error("CONSOLE", "Currently at Root level. To change region please use 'change-region <regioname>'");
"Currently at Root level. To change region please use 'change-region <regioname>'");
} }
else else
{ {
m_log.Notice("CONSOLE", m_console.Error("CONSOLE", "Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName +
"Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName +
". To change region please use 'change-region <regioname>'"); ". To change region please use 'change-region <regioname>'");
} }
@ -905,8 +886,8 @@ namespace OpenSim
case "set": case "set":
if (cmdparams.Length < 4) if (cmdparams.Length < 4)
{ {
m_log.Notice(n, "SYNTAX: " + n + " SET SECTION KEY VALUE"); m_console.Error(n, "SYNTAX: " + n + " SET SECTION KEY VALUE");
m_log.Notice(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); m_console.Error(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5");
} }
else else
{ {
@ -917,36 +898,34 @@ namespace OpenSim
c.Set(cmdparams[2], _value); c.Set(cmdparams[2], _value);
m_config.Merge(c.ConfigSource); m_config.Merge(c.ConfigSource);
m_log.Notice(n, m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
_value); _value);
} }
break; break;
case "get": case "get":
if (cmdparams.Length < 3) if (cmdparams.Length < 3)
{ {
m_log.Notice(n, "SYNTAX: " + n + " GET SECTION KEY"); m_console.Error(n, "SYNTAX: " + n + " GET SECTION KEY");
m_log.Notice(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads"); m_console.Error(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads");
} }
else else
{ {
IConfig c = DefaultConfig().Configs[cmdparams[1]]; IConfig c = DefaultConfig().Configs[cmdparams[1]];
if (c == null) if (c == null)
{ {
m_log.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist.");
break; break;
} }
else else
{ {
m_log.Notice(n, m_console.Notice(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " +
n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " +
c.GetString(cmdparams[2])); c.GetString(cmdparams[2]));
} }
} }
break; break;
case "save": case "save":
m_log.Notice(n, "Saving configuration file: " + Application.iniFilePath); m_console.Notice("Saving configuration file: " + Application.iniFilePath);
m_config.Save(Application.iniFilePath); m_config.Save(Application.iniFilePath);
break; break;
} }
@ -957,7 +936,7 @@ namespace OpenSim
* Temporarily disabled but it would be good to have this - needs to be levered * Temporarily disabled but it would be good to have this - needs to be levered
* in to BaseOpenSimServer (which requires a RunCmd method restrcuture probably) * in to BaseOpenSimServer (which requires a RunCmd method restrcuture probably)
default: default:
m_log.Error("Unknown command"); m_console.Error("Unknown command");
break; break;
*/ */
} }
@ -973,18 +952,18 @@ namespace OpenSim
int newDebug; int newDebug;
if (int.TryParse(args[1], out newDebug)) if (int.TryParse(args[1], out newDebug))
{ {
m_sceneManager.SetDebugPacketOnCurrentScene(m_log, newDebug); m_sceneManager.SetDebugPacketOnCurrentScene(newDebug);
} }
else else
{ {
m_log.Error("packet debug should be 0..2"); m_console.Error("packet debug should be 0..2");
} }
Console.WriteLine("New packet debug: " + newDebug.ToString()); m_console.Notice("New packet debug: " + newDebug.ToString());
} }
break; break;
default: default:
m_log.Error("Unknown debug"); m_console.Error("Unknown debug");
break; break;
} }
} }
@ -997,7 +976,7 @@ namespace OpenSim
switch (ShowWhat) switch (ShowWhat)
{ {
case "users": case "users":
m_log.Notice( m_console.Notice(
String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}", "Firstname", "Lastname", String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}", "Firstname", "Lastname",
"Agent ID", "Circuit", "IP", "Region")); "Agent ID", "Circuit", "IP", "Region"));
@ -1015,6 +994,7 @@ namespace OpenSim
{ {
regionName = regionInfo.RegionName; regionName = regionInfo.RegionName;
} }
for (int i = 0; i < m_udpServers.Count; i++) for (int i = 0; i < m_udpServers.Count; i++)
{ {
if (m_udpServers[i].RegionHandle == presence.RegionHandle) if (m_udpServers[i].RegionHandle == presence.RegionHandle)
@ -1023,7 +1003,8 @@ namespace OpenSim
m_udpServers[i].clientCircuits_reverse.TryGetValue(presence.ControllingClient.CircuitCode, out ep); m_udpServers[i].clientCircuits_reverse.TryGetValue(presence.ControllingClient.CircuitCode, out ep);
} }
} }
m_log.Notice(
m_console.Notice(
String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}", String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}",
presence.Firstname, presence.Firstname,
presence.Lastname, presence.Lastname,
@ -1035,10 +1016,10 @@ namespace OpenSim
break; break;
case "modules": case "modules":
m_log.Notice("The currently loaded shared modules are:"); m_console.Notice("The currently loaded shared modules are:");
foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)
{ {
m_log.Notice("Shared Module: " + module.Name); m_console.Notice("Shared Module: " + module.Name);
} }
break; break;
@ -1046,7 +1027,7 @@ namespace OpenSim
m_sceneManager.ForEachScene( m_sceneManager.ForEachScene(
delegate(Scene scene) delegate(Scene scene)
{ {
m_log.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " +
scene.RegionInfo.RegionLocX + " , Region YLoc: " + scene.RegionInfo.RegionLocX + " , Region YLoc: " +
scene.RegionInfo.RegionLocY); scene.RegionInfo.RegionLocY);
}); });
@ -1055,12 +1036,12 @@ namespace OpenSim
case "stats": case "stats":
if (StatsManager.SimExtraStats != null) if (StatsManager.SimExtraStats != null)
{ {
m_log.Notice( m_console.Notice(
"STATS", Environment.NewLine + StatsManager.SimExtraStats.Report()); "STATS", Environment.NewLine + StatsManager.SimExtraStats.Report());
} }
else else
{ {
m_log.Notice("STATS", "Extra sim statistics collection has not been enabled"); m_console.Notice("Extra sim statistics collection has not been enabled");
} }
break; break;
} }

View File

@ -51,6 +51,8 @@ namespace OpenSim.Region.ClientStack
/// </summary> /// </summary>
public class ClientView : IClientAPI public class ClientView : IClientAPI
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/* static variables */ /* static variables */
public static TerrainManager TerrainManager; public static TerrainManager TerrainManager;
@ -196,7 +198,7 @@ namespace OpenSim.Region.ClientStack
// m_inventoryCache = inventoryCache; // m_inventoryCache = inventoryCache;
m_authenticateSessionsHandler = authenSessions; m_authenticateSessionsHandler = authenSessions;
MainLog.Instance.Verbose("CLIENT", "Started up new client thread to handle incoming request"); m_log.Info("[CLIENT]: Started up new client thread to handle incoming request");
m_agentId = agentId; m_agentId = agentId;
m_sessionId = sessionId; m_sessionId = sessionId;
@ -260,7 +262,7 @@ namespace OpenSim.Region.ClientStack
public void Close(bool ShutdownCircult) public void Close(bool ShutdownCircult)
{ {
// Pull Client out of Region // Pull Client out of Region
MainLog.Instance.Verbose("CLIENT", "Close has been called"); m_log.Info("[CLIENT]: Close has been called");
//raiseevent on the packet server to Shutdown the circuit //raiseevent on the packet server to Shutdown the circuit
if (ShutdownCircult) if (ShutdownCircult)
@ -286,7 +288,7 @@ namespace OpenSim.Region.ClientStack
public void Stop() public void Stop()
{ {
MainLog.Instance.Verbose("BUG", "Stop called, please find out where and remove it"); m_log.Info("[BUG]: Stop called, please find out where and remove it");
} }
#endregion #endregion
@ -378,7 +380,7 @@ namespace OpenSim.Region.ClientStack
protected virtual void ClientLoop() protected virtual void ClientLoop()
{ {
MainLog.Instance.Verbose("CLIENT", "Entered loop"); m_log.Info("[CLIENT]: Entered loop");
while (true) while (true)
{ {
QueItem nextPacket = m_packetQueue.Dequeue(); QueItem nextPacket = m_packetQueue.Dequeue();
@ -445,7 +447,7 @@ namespace OpenSim.Region.ClientStack
m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
m_clientPingTimer.Enabled = true; m_clientPingTimer.Enabled = true;
MainLog.Instance.Verbose("CLIENT", "Adding viewer agent to scene"); m_log.Info("[CLIENT]: Adding viewer agent to scene");
m_scene.AddNewClient(this, true); m_scene.AddNewClient(this, true);
} }
@ -458,13 +460,13 @@ namespace OpenSim.Region.ClientStack
if (!sessionInfo.Authorised) if (!sessionInfo.Authorised)
{ {
//session/circuit not authorised //session/circuit not authorised
MainLog.Instance.Notice("CLIENT", "New user request denied to " + m_userEndPoint.ToString()); m_log.Info("[CLIENT]: New user request denied to " + m_userEndPoint.ToString());
m_packetQueue.Close(); m_packetQueue.Close();
m_clientThread.Abort(); m_clientThread.Abort();
} }
else else
{ {
MainLog.Instance.Notice("CLIENT", "Got authenticated connection from " + m_userEndPoint.ToString()); m_log.Info("[CLIENT]: Got authenticated connection from " + m_userEndPoint.ToString());
//session is authorised //session is authorised
m_firstName = sessionInfo.LoginInfo.First; m_firstName = sessionInfo.LoginInfo.First;
m_lastName = sessionInfo.LoginInfo.Last; m_lastName = sessionInfo.LoginInfo.Last;
@ -731,7 +733,7 @@ namespace OpenSim.Region.ClientStack
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("client", m_log.Warn("[client]: " +
"ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
} }
} }
@ -758,7 +760,7 @@ namespace OpenSim.Region.ClientStack
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("client", m_log.Warn("[client]: " +
"ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
} }
} }
@ -2102,7 +2104,7 @@ namespace OpenSim.Region.ClientStack
protected virtual bool Logout(IClientAPI client, Packet packet) protected virtual bool Logout(IClientAPI client, Packet packet)
{ {
MainLog.Instance.Verbose("CLIENT", "Got a logout request"); m_log.Info("[CLIENT]: Got a logout request");
if (OnLogout != null) if (OnLogout != null)
{ {
@ -2431,10 +2433,10 @@ namespace OpenSim.Region.ClientStack
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Warn("client", m_log.Warn("[client]: " +
"ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + "ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " +
m_userEndPoint.ToString() + " - killing thread"); m_userEndPoint.ToString() + " - killing thread");
MainLog.Instance.Error(e.ToString()); m_log.Error(e.ToString());
Close(true); Close(true);
} }
} }
@ -2545,7 +2547,7 @@ namespace OpenSim.Region.ClientStack
{ {
if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
{ {
MainLog.Instance.Verbose("NETWORK", "Resending " + packet.Type.ToString() + " packet, " + m_log.Info("[NETWORK]: Resending " + packet.Type.ToString() + " packet, " +
(now - packet.TickCount) + "ms have passed"); (now - packet.TickCount) + "ms have passed");
packet.Header.Resent = true; packet.Header.Resent = true;
@ -2564,11 +2566,11 @@ namespace OpenSim.Region.ClientStack
if (m_pendingAcks.Count > 250) if (m_pendingAcks.Count > 250)
{ {
// FIXME: Handle the odd case where we have too many pending ACKs queued up // FIXME: Handle the odd case where we have too many pending ACKs queued up
MainLog.Instance.Verbose("NETWORK", "Too many ACKs queued up!"); m_log.Info("[NETWORK]: Too many ACKs queued up!");
return; return;
} }
//MainLog.Instance.Verbose("NETWORK", "Sending PacketAck"); //m_log.Info("[NETWORK]: Sending PacketAck");
int i = 0; int i = 0;
PacketAckPacket acks = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); PacketAckPacket acks = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
@ -2754,7 +2756,7 @@ namespace OpenSim.Region.ClientStack
//rezPacket.RezData.RemoveItem; //rezPacket.RezData.RemoveItem;
//rezPacket.RezData.RezSelected; //rezPacket.RezData.RezSelected;
//rezPacket.RezData.FromTaskID; //rezPacket.RezData.FromTaskID;
//MainLog.Instance.Verbose("REZData", rezPacket.ToString()); //m_log.Info("[REZData]: " + rezPacket.ToString());
OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID, rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection, rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
@ -2772,7 +2774,7 @@ namespace OpenSim.Region.ClientStack
break; break;
case PacketType.ModifyLand: case PacketType.ModifyLand:
ModifyLandPacket modify = (ModifyLandPacket)Pack; ModifyLandPacket modify = (ModifyLandPacket)Pack;
//MainLog.Instance.Verbose("LAND", "LAND:" + modify.ToString()); //m_log.Info("[LAND]: LAND:" + modify.ToString());
if (modify.ParcelData.Length > 0) if (modify.ParcelData.Length > 0)
{ {
if (OnModifyTerrain != null) if (OnModifyTerrain != null)
@ -2941,7 +2943,7 @@ namespace OpenSim.Region.ClientStack
{ {
ObjectAddPacket addPacket = (ObjectAddPacket)Pack; ObjectAddPacket addPacket = (ObjectAddPacket)Pack;
PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
// MainLog.Instance.Verbose("REZData", addPacket.ToString()); // m_log.Info("[REZData]: " + addPacket.ToString());
//BypassRaycast: 1 //BypassRaycast: 1
//RayStart: <69.79469, 158.2652, 98.40343> //RayStart: <69.79469, 158.2652, 98.40343>
//RayEnd: <61.97724, 141.995, 92.58341> //RayEnd: <61.97724, 141.995, 92.58341>
@ -3068,7 +3070,7 @@ namespace OpenSim.Region.ClientStack
} }
break; break;
case PacketType.ObjectPermissions: case PacketType.ObjectPermissions:
MainLog.Instance.Warn("CLIENT", "unhandled packet " + PacketType.ObjectPermissions.ToString()); m_log.Warn("[CLIENT]: unhandled packet " + PacketType.ObjectPermissions.ToString());
ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack;
List<ObjectPermissionsPacket.ObjectDataBlock> permChanges = List<ObjectPermissionsPacket.ObjectDataBlock> permChanges =
@ -3344,7 +3346,7 @@ namespace OpenSim.Region.ClientStack
} }
break; break;
case PacketType.MoveTaskInventory: case PacketType.MoveTaskInventory:
MainLog.Instance.Warn("CLIENT", "unhandled MoveTaskInventory packet"); m_log.Warn("[CLIENT]: unhandled MoveTaskInventory packet");
break; break;
case PacketType.RezScript: case PacketType.RezScript:
//Console.WriteLine(Pack.ToString()); //Console.WriteLine(Pack.ToString());
@ -3594,7 +3596,7 @@ namespace OpenSim.Region.ClientStack
break; break;
case PacketType.GodKickUser: case PacketType.GodKickUser:
MainLog.Instance.Warn("CLIENT", "unhandled GodKickUser packet"); m_log.Warn("[CLIENT]: unhandled GodKickUser packet");
GodKickUserPacket gkupack = (GodKickUserPacket)Pack; GodKickUserPacket gkupack = (GodKickUserPacket)Pack;
@ -3624,88 +3626,88 @@ namespace OpenSim.Region.ClientStack
// Send the client the ping response back // Send the client the ping response back
// Pass the same PingID in the matching packet // Pass the same PingID in the matching packet
// Handled In the packet processing // Handled In the packet processing
//MainLog.Instance.Debug("CLIENT", "possibly unhandled StartPingCheck packet"); //m_log.Debug("[CLIENT]: possibly unhandled StartPingCheck packet");
break; break;
case PacketType.CompletePingCheck: case PacketType.CompletePingCheck:
// TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client
//MainLog.Instance.Warn("CLIENT", "unhandled CompletePingCheck packet"); //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
break; break;
case PacketType.ObjectScale: case PacketType.ObjectScale:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled ObjectScale packet"); m_log.Warn("[CLIENT]: unhandled ObjectScale packet");
break; break;
case PacketType.ViewerStats: case PacketType.ViewerStats:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled ViewerStats packet"); m_log.Warn("[CLIENT]: unhandled ViewerStats packet");
break; break;
case PacketType.CreateGroupRequest: case PacketType.CreateGroupRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled CreateGroupRequest packet"); m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet");
break; break;
case PacketType.GenericMessage: case PacketType.GenericMessage:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled GenericMessage packet"); m_log.Warn("[CLIENT]: unhandled GenericMessage packet");
break; break;
case PacketType.MapItemRequest: case PacketType.MapItemRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled MapItemRequest packet"); m_log.Warn("[CLIENT]: unhandled MapItemRequest packet");
break; break;
case PacketType.AgentResume: case PacketType.AgentResume:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled AgentResume packet"); m_log.Warn("[CLIENT]: unhandled AgentResume packet");
break; break;
case PacketType.AgentPause: case PacketType.AgentPause:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled AgentPause packet"); m_log.Warn("[CLIENT]: unhandled AgentPause packet");
break; break;
case PacketType.TransferAbort: case PacketType.TransferAbort:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled TransferAbort packet"); m_log.Warn("[CLIENT]: unhandled TransferAbort packet");
break; break;
case PacketType.MuteListRequest: case PacketType.MuteListRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled MuteListRequest packet"); m_log.Warn("[CLIENT]: unhandled MuteListRequest packet");
break; break;
case PacketType.AgentDataUpdateRequest: case PacketType.AgentDataUpdateRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled AgentDataUpdateRequest packet"); m_log.Warn("[CLIENT]: unhandled AgentDataUpdateRequest packet");
break; break;
case PacketType.ParcelDwellRequest: case PacketType.ParcelDwellRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled ParcelDwellRequest packet"); m_log.Warn("[CLIENT]: unhandled ParcelDwellRequest packet");
break; break;
case PacketType.UseCircuitCode: case PacketType.UseCircuitCode:
// TODO: handle this packet // TODO: handle this packet
//MainLog.Instance.Warn("CLIENT", "unhandled UseCircuitCode packet"); //m_log.Warn("[CLIENT]: unhandled UseCircuitCode packet");
break; break;
case PacketType.EconomyDataRequest: case PacketType.EconomyDataRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled EconomyDataRequest packet"); m_log.Warn("[CLIENT]: unhandled EconomyDataRequest packet");
break; break;
case PacketType.AgentHeightWidth: case PacketType.AgentHeightWidth:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled AgentHeightWidth packet"); m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet");
break; break;
case PacketType.ObjectSpinStop: case PacketType.ObjectSpinStop:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled ObjectSpinStop packet"); m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet");
break; break;
case PacketType.SoundTrigger: case PacketType.SoundTrigger:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled SoundTrigger packet"); m_log.Warn("[CLIENT]: unhandled SoundTrigger packet");
break; break;
case PacketType.UserInfoRequest: case PacketType.UserInfoRequest:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled UserInfoRequest packet"); m_log.Warn("[CLIENT]: unhandled UserInfoRequest packet");
break; break;
case PacketType.InventoryDescendents: case PacketType.InventoryDescendents:
// TODO: handle this packet // TODO: handle this packet
MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet"); m_log.Warn("[CLIENT]: unhandled InventoryDescent packet");
break; break;
default: default:
MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString()); m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
break; break;
#endregion #endregion

View File

@ -37,6 +37,8 @@ namespace OpenSim.Region.ClientStack
{ {
public class PacketQueue public class PacketQueue
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private bool m_enabled = true; private bool m_enabled = true;
private BlockingQueue<QueItem> SendQueue; private BlockingQueue<QueItem> SendQueue;
@ -204,7 +206,7 @@ namespace OpenSim.Region.ClientStack
SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue()); SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue());
} }
} }
// MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets"); // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets");
} }
} }
@ -253,7 +255,7 @@ namespace OpenSim.Region.ClientStack
lock (this) lock (this)
{ {
ResetCounters(); ResetCounters();
// MainLog.Instance.Verbose("THROTTLE", "Entering Throttle"); // m_log.Info("[THROTTLE]: Entering Throttle");
while (TotalThrottle.UnderLimit() && PacketsWaiting() && while (TotalThrottle.UnderLimit() && PacketsWaiting() &&
(throttleLoops <= MaxThrottleLoops)) (throttleLoops <= MaxThrottleLoops))
{ {
@ -316,7 +318,7 @@ namespace OpenSim.Region.ClientStack
AssetThrottle.Add(qpack.Packet.ToBytes().Length); AssetThrottle.Add(qpack.Packet.ToBytes().Length);
} }
} }
// MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets"); // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets");
} }
} }
@ -426,7 +428,7 @@ namespace OpenSim.Region.ClientStack
tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset; tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset;
/* /*
MainLog.Instance.Verbose("CLIENT", "Client AgentThrottle - Got throttle:resendbytes=" + tResend + m_log.Info("[CLIENT]: Client AgentThrottle - Got throttle:resendbytes=" + tResend +
" landbytes=" + tLand + " landbytes=" + tLand +
" windbytes=" + tWind + " windbytes=" + tWind +
" cloudbytes=" + tCloud + " cloudbytes=" + tCloud +

View File

@ -42,6 +42,8 @@ namespace OpenSim.Region.ClientStack
{ {
public abstract class RegionApplicationBase : BaseOpenSimServer public abstract class RegionApplicationBase : BaseOpenSimServer
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected AssetCache m_assetCache; protected AssetCache m_assetCache;
protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>();
protected NetworkServersInfo m_networkServersInfo; protected NetworkServersInfo m_networkServersInfo;
@ -75,19 +77,20 @@ namespace OpenSim.Region.ClientStack
m_httpServer = new BaseHttpServer(m_httpServerPort); m_httpServer = new BaseHttpServer(m_httpServerPort);
m_log.Status("REGION", "Starting HTTP server"); m_log.Info("[REGION]: Starting HTTP server");
m_httpServer.Start(); m_httpServer.Start();
} }
protected abstract void Initialize(); protected abstract void Initialize();
protected void StartLog() protected void StartConsole()
{ {
m_log = CreateLog(); m_console = CreateConsole();
MainLog.Instance = m_log; MainConsole.Instance = m_console;
} }
protected abstract LogBase CreateLog(); protected abstract ConsoleBase CreateConsole();
protected abstract PhysicsScene GetPhysicsScene(); protected abstract PhysicsScene GetPhysicsScene();
protected abstract StorageManager CreateStorageManager(string connectionstring); protected abstract StorageManager CreateStorageManager(string connectionstring);
@ -107,7 +110,7 @@ namespace OpenSim.Region.ClientStack
// listenIP = IPAddress.Parse("0.0.0.0"); // listenIP = IPAddress.Parse("0.0.0.0");
uint port = (uint) regionInfo.InternalEndPoint.Port; uint port = (uint) regionInfo.InternalEndPoint.Port;
udpServer = new UDPServer(listenIP, ref port, regionInfo.m_allow_alternate_ports, m_assetCache, m_log, circuitManager); udpServer = new UDPServer(listenIP, ref port, regionInfo.m_allow_alternate_ports, m_assetCache, circuitManager);
regionInfo.InternalEndPoint.Port = (int)port; regionInfo.InternalEndPoint.Port = (int)port;
Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
@ -136,12 +139,12 @@ namespace OpenSim.Region.ClientStack
if (masterAvatar != null) if (masterAvatar != null)
{ {
m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToString() + "]"); m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.UUID.ToString() + "]");
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
} }
else else
{ {
m_log.Verbose("PARCEL", "No master avatar found, using null."); m_log.Info("[PARCEL]: No master avatar found, using null.");
scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero; scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero;
} }

View File

@ -39,6 +39,8 @@ namespace OpenSim.Region.ClientStack
{ {
public class UDPServer : ClientStackNetworkHandler public class UDPServer : ClientStackNetworkHandler
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
public Dictionary<uint, EndPoint> clientCircuits_reverse = new Dictionary<uint, EndPoint>(); public Dictionary<uint, EndPoint> clientCircuits_reverse = new Dictionary<uint, EndPoint>();
public Socket Server; public Socket Server;
@ -56,7 +58,6 @@ namespace OpenSim.Region.ClientStack
protected IPAddress listenIP = IPAddress.Parse("0.0.0.0"); protected IPAddress listenIP = IPAddress.Parse("0.0.0.0");
protected IScene m_localScene; protected IScene m_localScene;
protected AssetCache m_assetCache; protected AssetCache m_assetCache;
protected LogBase m_log;
protected AgentCircuitManager m_authenticateSessionsClass; protected AgentCircuitManager m_authenticateSessionsClass;
public PacketServer PacketServer public PacketServer PacketServer
@ -84,13 +85,12 @@ namespace OpenSim.Region.ClientStack
{ {
} }
public UDPServer(IPAddress _listenIP, ref uint port, bool allow_alternate_port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass) public UDPServer(IPAddress _listenIP, ref uint port, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager authenticateClass)
{ {
listenIP = _listenIP; listenIP = _listenIP;
listenPort = port; listenPort = port;
Allow_Alternate_Port = allow_alternate_port; Allow_Alternate_Port = allow_alternate_port;
m_assetCache = assetCache; m_assetCache = assetCache;
m_log = console;
m_authenticateSessionsClass = authenticateClass; m_authenticateSessionsClass = authenticateClass;
CreatePacketServer(); CreatePacketServer();
@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
{ {
// TODO : Actually only handle those states that we have control over, re-throw everything else, // TODO : Actually only handle those states that we have control over, re-throw everything else,
// TODO: implement cases as we encounter them. // TODO: implement cases as we encounter them.
//m_log.Error("UDPSERVER", "Connection Error! - " + e.ToString()); //m_log.Error("[UDPSERVER]: Connection Error! - " + e.ToString());
switch (e.SocketErrorCode) switch (e.SocketErrorCode)
{ {
case SocketError.AlreadyInProgress: case SocketError.AlreadyInProgress:
@ -134,7 +134,7 @@ namespace OpenSim.Region.ClientStack
} }
catch (Exception a) catch (Exception a)
{ {
MainLog.Instance.Verbose("UDPSERVER", a.ToString()); m_log.Info("[UDPSERVER]: " + a.ToString());
} }
try try
{ {
@ -159,7 +159,7 @@ namespace OpenSim.Region.ClientStack
} }
catch (Exception) catch (Exception)
{ {
//MainLog.Instance.Verbose("UDPSERVER", a.ToString()); //m_log.Info("[UDPSERVER]" + a.ToString());
} }
try try
{ {
@ -191,8 +191,7 @@ namespace OpenSim.Region.ClientStack
} }
catch (ObjectDisposedException) catch (ObjectDisposedException)
{ {
//m_log.Debug("[UDPSERVER]: " + e.ToString());
//MainLog.Instance.Debug("UDPSERVER", e.ToString());
return; return;
} }
@ -214,20 +213,20 @@ namespace OpenSim.Region.ClientStack
if (clientCircuits.TryGetValue(epSender, out circuit)) if (clientCircuits.TryGetValue(epSender, out circuit))
{ {
//if so then send packet to the packetserver //if so then send packet to the packetserver
//MainLog.Instance.Warn("UDPSERVER", "ALREADY HAVE Circuit!"); //m_log.Warn("[UDPSERVER]: ALREADY HAVE Circuit!");
m_packetServer.InPacket(circuit, packet); m_packetServer.InPacket(circuit, packet);
} }
else if (packet.Type == PacketType.UseCircuitCode) else if (packet.Type == PacketType.UseCircuitCode)
{ {
// new client // new client
MainLog.Instance.Debug("UDPSERVER", "Adding New Client"); m_log.Debug("[UDPSERVER]: Adding New Client");
AddNewClient(packet); AddNewClient(packet);
} }
else else
{ {
// invalid client // invalid client
//CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now //CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now
//m_log.Warn("UDPSERVER", "Got a packet from an invalid client - " + packet.ToString()); //m_log.Warn("[UDPSERVER]: Got a packet from an invalid client - " + packet.ToString());
} }
} }
@ -255,12 +254,11 @@ namespace OpenSim.Region.ClientStack
public void ServerListener() public void ServerListener()
{ {
uint newPort = listenPort; uint newPort = listenPort;
for (uint i = 0; i < 20; i++) for (uint i = 0; i < 20; i++)
{ {
newPort = listenPort + i; newPort = listenPort + i;
m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ".");// Allow alternate ports: " + Allow_Alternate_Port.ToString()); m_log.Info("[SERVER]: Opening UDP socket on " + listenIP.ToString() + " " + newPort + ".");// Allow alternate ports: " + Allow_Alternate_Port.ToString());
try try
{ {
ServerIncoming = new IPEndPoint(listenIP, (int) newPort); ServerIncoming = new IPEndPoint(listenIP, (int) newPort);
@ -276,19 +274,19 @@ namespace OpenSim.Region.ClientStack
throw (ex); throw (ex);
// We are looking for alternate ports! // We are looking for alternate ports!
m_log.Verbose("SERVER", "UDP socket on " + listenIP.ToString() + " " + listenPort.ToString() + " is not available, trying next."); m_log.Info("[SERVER]: UDP socket on " + listenIP.ToString() + " " + listenPort.ToString() + " is not available, trying next.");
} }
System.Threading.Thread.Sleep(100); // Wait before we retry socket System.Threading.Thread.Sleep(100); // Wait before we retry socket
} }
m_log.Verbose("SERVER", "UDP socket bound, getting ready to listen"); m_log.Info("[SERVER]: UDP socket bound, getting ready to listen");
ipeSender = new IPEndPoint(listenIP, 0); ipeSender = new IPEndPoint(listenIP, 0);
epSender = (EndPoint) ipeSender; epSender = (EndPoint) ipeSender;
ReceivedData = new AsyncCallback(OnReceivedData); ReceivedData = new AsyncCallback(OnReceivedData);
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
m_log.Status("SERVER", "Listening on port " + newPort); m_log.Info("[SERVER]: Listening on port " + newPort);
} }
public virtual void RegisterPacketServer(PacketServer server) public virtual void RegisterPacketServer(PacketServer server)

View File

@ -36,6 +36,8 @@ namespace OpenSim.Region.Communications.Local
{ {
public class LocalBackEndServices : IGridServices, IInterRegionCommunications public class LocalBackEndServices : IGridServices, IInterRegionCommunications
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>(); protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>();
protected Dictionary<ulong, RegionCommsListener> m_regionListeners = protected Dictionary<ulong, RegionCommsListener> m_regionListeners =
@ -93,8 +95,9 @@ namespace OpenSim.Region.Communications.Local
RegionCommsListener regionHost = new RegionCommsListener(); RegionCommsListener regionHost = new RegionCommsListener();
if (m_regionListeners.ContainsKey(regionInfo.RegionHandle)) if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
{ {
MainLog.Instance.Error("INTERREGION", m_log.Error("[INTERREGION]: " +
"Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up."); "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. " +
"In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up.");
m_regionListeners.Remove(regionInfo.RegionHandle); m_regionListeners.Remove(regionInfo.RegionHandle);
} }
m_regionListeners.Add(regionInfo.RegionHandle, regionHost); m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
@ -105,7 +108,7 @@ namespace OpenSim.Region.Communications.Local
{ {
// Already in our list, so the region went dead and restarted. // Already in our list, so the region went dead and restarted.
m_regions.Remove(regionInfo.RegionHandle); m_regions.Remove(regionInfo.RegionHandle);
MainLog.Instance.Warn("INTERREGION", "Region registered twice. Region went down and came back up."); m_log.Warn("[INTERREGION]: Region registered twice. Region went down and came back up.");
RegionCommsListener regionHost = new RegionCommsListener(); RegionCommsListener regionHost = new RegionCommsListener();
if (m_regionListeners.ContainsKey(regionInfo.RegionHandle)) if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
@ -229,7 +232,7 @@ namespace OpenSim.Region.Communications.Local
{ {
// Console.WriteLine("CommsManager- Informing a region to expect child agent"); // Console.WriteLine("CommsManager- Informing a region to expect child agent");
m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData); m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData);
//MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
return true; return true;
} }
@ -292,13 +295,13 @@ namespace OpenSim.Region.Communications.Local
//should change from agentCircuitData //should change from agentCircuitData
{ {
//Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
//MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname);
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
// Console.WriteLine("CommsManager- Informing a region to expect child agent"); // Console.WriteLine("CommsManager- Informing a region to expect child agent");
m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
//MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
return true; return true;
} }
@ -389,11 +392,11 @@ namespace OpenSim.Region.Communications.Local
public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
{ {
//MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname);
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
//MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
} }
@ -443,11 +446,11 @@ namespace OpenSim.Region.Communications.Local
public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
{ {
// MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname); // m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname);
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))
{ {
//MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname);
TriggerExpectUser(regionHandle, agentData); TriggerExpectUser(regionHandle, agentData);
return true; return true;

View File

@ -44,6 +44,8 @@ namespace OpenSim.Region.Communications.Local
public class LocalLoginService : LoginService public class LocalLoginService : LoginService
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private CommunicationsLocal m_Parent; private CommunicationsLocal m_Parent;
private NetworkServersInfo serversInfo; private NetworkServersInfo serversInfo;
@ -77,7 +79,7 @@ namespace OpenSim.Region.Communications.Local
if (!authUsers) if (!authUsers)
{ {
//no current user account so make one //no current user account so make one
MainLog.Instance.Notice("LOGIN", "No user account found so creating a new one."); m_log.Info("[LOGIN]: No user account found so creating a new one.");
m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
@ -97,14 +99,14 @@ namespace OpenSim.Region.Communications.Local
if (!authUsers) if (!authUsers)
{ {
//for now we will accept any password in sandbox mode //for now we will accept any password in sandbox mode
MainLog.Instance.Notice("LOGIN", "Authorising user (no actual password check)"); m_log.Info("[LOGIN]: Authorising user (no actual password check)");
return true; return true;
} }
else else
{ {
MainLog.Instance.Notice( m_log.Info(
"LOGIN", "Authenticating " + profile.username + " " + profile.surname); "[LOGIN]: Authenticating " + profile.username + " " + profile.surname);
if (!password.StartsWith("$1$")) if (!password.StartsWith("$1$"))
password = "$1$" + Util.Md5Hash(password); password = "$1$" + Util.Md5Hash(password);
@ -166,7 +168,7 @@ namespace OpenSim.Region.Communications.Local
} }
else else
{ {
MainLog.Instance.Warn("LOGIN", "Not found region " + currentRegion); m_log.Warn("[LOGIN]: Not found region " + currentRegion);
} }
} }
private LoginResponse.BuddyList ConvertFriendListItem(List<FriendListItem> LFL) private LoginResponse.BuddyList ConvertFriendListItem(List<FriendListItem> LFL)

View File

@ -47,6 +47,8 @@ namespace OpenSim.Region.Communications.OGS1
{ {
public class OGS1GridServices : IGridServices, IInterRegionCommunications public class OGS1GridServices : IGridServices, IInterRegionCommunications
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private LocalBackEndServices m_localBackend = new LocalBackEndServices(); private LocalBackEndServices m_localBackend = new LocalBackEndServices();
private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>(); private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>();
@ -138,7 +140,7 @@ namespace OpenSim.Region.Communications.OGS1
GridResp = GridReq.Send(serversInfo.GridURL, 10000); GridResp = GridReq.Send(serversInfo.GridURL, 10000);
} catch (Exception ex) } catch (Exception ex)
{ {
MainLog.Instance.Error("Unable to connect to grid. Grid server not running?"); m_log.Error("Unable to connect to grid. Grid server not running?");
throw(ex); throw(ex);
} }
Hashtable GridRespData = (Hashtable)GridResp.Value; Hashtable GridRespData = (Hashtable)GridResp.Value;
@ -148,7 +150,7 @@ namespace OpenSim.Region.Communications.OGS1
if (GridRespData.ContainsKey("error")) if (GridRespData.ContainsKey("error"))
{ {
string errorstring = (string) GridRespData["error"]; string errorstring = (string) GridRespData["error"];
MainLog.Instance.Error("Unable to connect to grid: " + errorstring); m_log.Error("Unable to connect to grid: " + errorstring);
return null; return null;
} }
else else
@ -330,7 +332,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (WebException) catch (WebException)
{ {
MainLog.Instance.Error("GRID", m_log.Error("[GRID]: " +
"Region lookup failed for: " + regionHandle.ToString() + "Region lookup failed for: " + regionHandle.ToString() +
" - Is the GridServer down?"); " - Is the GridServer down?");
return null; return null;
@ -421,7 +423,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("MapBlockQuery XMLRPC failure: " + e.ToString()); m_log.Error("MapBlockQuery XMLRPC failure: " + e.ToString());
return new Hashtable(); return new Hashtable();
} }
} }
@ -482,7 +484,7 @@ namespace OpenSim.Region.Communications.OGS1
m_localBackend.TriggerExpectUser(regionHandle, agentData); m_localBackend.TriggerExpectUser(regionHandle, agentData);
MainLog.Instance.Verbose("GRID", "Welcoming new user..."); m_log.Info("[GRID]: Welcoming new user...");
return new XmlRpcResponse(); return new XmlRpcResponse();
} }
@ -555,7 +557,7 @@ namespace OpenSim.Region.Communications.OGS1
Console.WriteLine("remoting object not found"); Console.WriteLine("remoting object not found");
} }
remObject = null; remObject = null;
//MainLog.Instance.Verbose("INTER", //m_log.Info("[INTER]: " +
//gdebugRegionName + //gdebugRegionName +
//": OGS1 tried to Update Child Agent data on outside region and got " + //": OGS1 tried to Update Child Agent data on outside region and got " +
//retValue.ToString()); //retValue.ToString());
@ -569,45 +571,45 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (SocketException e) catch (SocketException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + " " + m_log.Warn("Socket Error: Unable to connect to adjacent region: " + " " +
regInfo.RegionLocX + "," + regInfo.RegionLocY); regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (InvalidCredentialException e) catch (InvalidCredentialException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + m_log.Warn("Authentication exception: Unable to connect to adjacent region: " +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (Exception e) catch (Exception e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
} }
else else
{ {
//MainLog.Instance.Verbose("INTERREGION", "Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString()); //m_log.Info("[INTERREGION]: Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString());
return false; return false;
} }
} }
@ -650,7 +652,7 @@ namespace OpenSim.Region.Communications.OGS1
Console.WriteLine("remoting object not found"); Console.WriteLine("remoting object not found");
} }
remObject = null; remObject = null;
MainLog.Instance.Verbose("INTER", m_log.Info("[INTER]: " +
gdebugRegionName + ": OGS1 tried to InformRegionOfChildAgent for " + gdebugRegionName + ": OGS1 tried to InformRegionOfChildAgent for " +
agentData.firstname + " " + agentData.lastname + " and got " + agentData.firstname + " " + agentData.lastname + " and got " +
retValue.ToString()); retValue.ToString());
@ -664,41 +666,41 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (SocketException e) catch (SocketException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " +
regInfo.RegionLocX + "," + regInfo.RegionLocY); regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (InvalidCredentialException e) catch (InvalidCredentialException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + m_log.Warn("Authentication exception: Unable to connect to adjacent region: " +
regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (Exception e) catch (Exception e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
} }
@ -748,7 +750,7 @@ namespace OpenSim.Region.Communications.OGS1
Console.WriteLine("remoting object not found"); Console.WriteLine("remoting object not found");
} }
remObject = null; remObject = null;
MainLog.Instance.Verbose("INTER", gdebugRegionName + ": OGS1 tried to inform region I'm up"); m_log.Info("[INTER]: " + gdebugRegionName + ": OGS1 tried to inform region I'm up");
return retValue; return retValue;
} }
@ -765,49 +767,49 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException e) catch (RemotingException e)
{ {
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region using tcp://" + m_log.Warn("Remoting Error: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
" - Is this neighbor up?"); " - Is this neighbor up?");
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (SocketException e) catch (SocketException e)
{ {
MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + m_log.Warn("Socket Error: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
" - Is this neighbor up?"); " - Is this neighbor up?");
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (InvalidCredentialException e) catch (InvalidCredentialException e)
{ {
MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {
MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + m_log.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (Exception e) catch (Exception e)
{ {
// This line errors with a Null Reference Exception.. Why? @.@ // This line errors with a Null Reference Exception.. Why? @.@
//MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + //m_log.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress +
// ":" + regInfo.RemotingPort + // ":" + regInfo.RemotingPort +
//"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one"); //"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one");
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
} }
@ -860,41 +862,41 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (SocketException e) catch (SocketException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " +
regInfo.RegionLocX + "," + regInfo.RegionLocY); regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (InvalidCredentialException e) catch (InvalidCredentialException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + m_log.Warn("Authentication exception: Unable to connect to adjacent region: " +
regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (Exception e) catch (Exception e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
} }
@ -947,9 +949,9 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch catch
@ -1000,9 +1002,9 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch catch
@ -1052,61 +1054,61 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName + m_log.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY); " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
//MainLog.Instance.Debug(e.ToString()); //m_log.Debug(e.ToString());
return false; return false;
} }
catch (SocketException e) catch (SocketException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" + m_log.Warn("Socket Error: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
" - Is this neighbor up?"); " - Is this neighbor up?");
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (InvalidCredentialException e) catch (InvalidCredentialException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" + m_log.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (AuthenticationException e) catch (AuthenticationException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" + m_log.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (WebException e) catch (WebException e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
MainLog.Instance.Warn("WebException exception: Unable to connect to adjacent region using tcp://" + m_log.Warn("WebException exception: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress + regInfo.RemotingAddress +
":" + regInfo.RemotingPort + ":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
catch (Exception e) catch (Exception e)
{ {
NoteDeadRegion(regionHandle); NoteDeadRegion(regionHandle);
// This line errors with a Null Reference Exception.. Why? @.@ // This line errors with a Null Reference Exception.. Why? @.@
//MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress + //m_log.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress +
// ":" + regInfo.RemotingPort + // ":" + regInfo.RemotingPort +
//"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one"); //"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one");
MainLog.Instance.Debug(e.ToString()); m_log.Debug(e.ToString());
return false; return false;
} }
} }
@ -1133,7 +1135,7 @@ namespace OpenSim.Region.Communications.OGS1
/// <returns></returns> /// <returns></returns>
public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
{ {
//MainLog.Instance.Verbose("INTER", gdebugRegionName + ": Incoming OGS1 Agent " + agentData.firstname + " " + agentData.lastname); //m_log.Info("[INTER]: " + gdebugRegionName + ": Incoming OGS1 Agent " + agentData.firstname + " " + agentData.lastname);
try try
{ {
@ -1141,14 +1143,14 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException) catch (RemotingException)
{ {
//MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); //m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false; return false;
} }
} }
public bool TriggerRegionUp(SearializableRegionInfo regionData, ulong regionhandle) public bool TriggerRegionUp(SearializableRegionInfo regionData, ulong regionhandle)
{ {
MainLog.Instance.Verbose("INTER", m_log.Info("[INTER]: " +
gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX + gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX +
"," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries"); "," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries");
@ -1169,14 +1171,14 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e) catch (RemotingException e)
{ {
MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false; return false;
} }
} }
public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
{ {
//MainLog.Instance.Verbose("INTER", "Incoming OGS1 Child Agent Data Update"); //m_log.Info("[INTER]: Incoming OGS1 Child Agent Data Update");
try try
{ {
@ -1184,7 +1186,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException e) catch (RemotingException e)
{ {
MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false; return false;
} }
} }
@ -1206,7 +1208,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException e) catch (RemotingException e)
{ {
MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false; return false;
} }
} }
@ -1226,7 +1228,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException e) catch (RemotingException e)
{ {
MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false; return false;
} }
} }
@ -1239,7 +1241,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException e) catch (RemotingException e)
{ {
MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false; return false;
} }
} }
@ -1252,7 +1254,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (RemotingException) catch (RemotingException)
{ {
MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to neighbour to tell it to close a child connection"); m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to neighbour to tell it to close a child connection");
return false; return false;
} }

View File

@ -141,6 +141,8 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1InterRegionRemoting : MarshalByRefObject public class OGS1InterRegionRemoting : MarshalByRefObject
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public OGS1InterRegionRemoting() public OGS1InterRegionRemoting()
{ {
} }
@ -230,16 +232,16 @@ namespace OpenSim.Region.Communications.OGS1
return false; return false;
} }
} }
public bool TellRegionToCloseChildConnection(ulong regionHandle, Guid agentID) public bool TellRegionToCloseChildConnection(ulong regionHandle, Guid agentID)
{ {
try try
{ {
return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID)); return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID));
} }
catch (RemotingException) catch (RemotingException)
{ {
OpenSim.Framework.Console.MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to remote region: " + regionHandle.ToString()); m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to remote region: " + regionHandle.ToString());
return false; return false;
} }
} }

View File

@ -38,6 +38,8 @@ namespace OpenSim.Region.Communications.OGS1
{ {
public class OGS1InventoryService : IInventoryServices public class OGS1InventoryService : IInventoryServices
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private string _inventoryServerUrl; private string _inventoryServerUrl;
private Dictionary<LLUUID, InventoryRequest> m_RequestingInventory = new Dictionary<LLUUID, InventoryRequest>(); private Dictionary<LLUUID, InventoryRequest> m_RequestingInventory = new Dictionary<LLUUID, InventoryRequest>();
@ -71,9 +73,9 @@ namespace OpenSim.Region.Communications.OGS1
{ {
try try
{ {
MainLog.Instance.Verbose( m_log.Info(
"INVENTORY", "Requesting inventory from {0}/GetInventory/ for user {1}", String.Format("[INVENTORY]: Requesting inventory from {0}/GetInventory/ for user {1}",
_inventoryServerUrl, userID); _inventoryServerUrl, userID));
RestObjectPosterResponse<InventoryCollection> requester RestObjectPosterResponse<InventoryCollection> requester
= new RestObjectPosterResponse<InventoryCollection>(); = new RestObjectPosterResponse<InventoryCollection>();
@ -83,7 +85,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Error("INVENTORY", e.ToString()); m_log.Error("[INVENTORY]: " + e.ToString());
} }
} }
@ -96,9 +98,9 @@ namespace OpenSim.Region.Communications.OGS1
LLUUID userID = response.UserID; LLUUID userID = response.UserID;
if (m_RequestingInventory.ContainsKey(userID)) if (m_RequestingInventory.ContainsKey(userID))
{ {
MainLog.Instance.Verbose("INVENTORY", m_log.Info(String.Format("[INVENTORY]: " +
"Received inventory response for user {0} containing {1} folders and {2} items", "Received inventory response for user {0} containing {1} folders and {2} items",
userID, response.Folders.Count, response.AllItems.Count); userID, response.Folders.Count, response.AllItems.Count));
InventoryFolderImpl rootFolder = null; InventoryFolderImpl rootFolder = null;
InventoryRequest request = m_RequestingInventory[userID]; InventoryRequest request = m_RequestingInventory[userID];
@ -132,10 +134,10 @@ namespace OpenSim.Region.Communications.OGS1
} }
else else
{ {
MainLog.Instance.Warn( m_log.Warn(
"INVENTORY", String.Format("[INVENTORY]: " +
"Received inventory response for {0} for which we do not have a record of requesting!", "Received inventory response for {0} for which we do not have a record of requesting!",
userID); userID));
} }
} }

View File

@ -40,6 +40,8 @@ namespace OpenSim.Region.Communications.OGS1
{ {
public class OGS1UserServices : IUserService public class OGS1UserServices : IUserService
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private CommunicationsOGS1 m_parent; private CommunicationsOGS1 m_parent;
public OGS1UserServices(CommunicationsOGS1 parent) public OGS1UserServices(CommunicationsOGS1 parent)
@ -51,7 +53,7 @@ namespace OpenSim.Region.Communications.OGS1
{ {
if (data.Contains("error_type")) if (data.Contains("error_type"))
{ {
MainLog.Instance.Warn("GRID", m_log.Warn("[GRID]: " +
"Error sent by user server when trying to get user profile: (" + "Error sent by user server when trying to get user profile: (" +
data["error_type"] + data["error_type"] +
"): " + data["error_desc"]); "): " + data["error_desc"]);
@ -104,7 +106,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
else else
{ {
MainLog.Instance.Warn("INTERGRID", "Got invalid queryID from userServer"); m_log.Warn("[INTERGRID]: Got invalid queryID from userServer");
} }
return pickerlist; return pickerlist;
} }
@ -158,7 +160,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (System.Net.WebException) catch (System.Net.WebException)
{ {
MainLog.Instance.Warn("LOGOFF", "Unable to notify grid server of user logoff"); m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff");
} }
@ -186,7 +188,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (WebException e) catch (WebException e)
{ {
MainLog.Instance.Warn("Error when trying to fetch Avatar Picker Response: " + m_log.Warn("Error when trying to fetch Avatar Picker Response: " +
e.Message); e.Message);
// Return Empty picker list (no results) // Return Empty picker list (no results)
} }
@ -209,7 +211,7 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (WebException e) catch (WebException e)
{ {
MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " + m_log.Warn("Error when trying to fetch profile data by name from remote user server: " +
e.Message); e.Message);
} }
return null; return null;
@ -299,23 +301,23 @@ namespace OpenSim.Region.Communications.OGS1
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to add new friend, User Server Reported an issue"); m_log.Warn("[GRID]: Unable to add new friend, User Server Reported an issue");
} }
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!"); m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!");
} }
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!"); m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!");
} }
} }
catch (WebException e) catch (WebException e)
{ {
MainLog.Instance.Warn("GRID","Error when trying to AddNewUserFriend: " + m_log.Warn("[GRID]: Error when trying to AddNewUserFriend: " +
e.Message); e.Message);
} }
@ -352,23 +354,23 @@ namespace OpenSim.Region.Communications.OGS1
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to remove friend, User Server Reported an issue"); m_log.Warn("[GRID]: Unable to remove friend, User Server Reported an issue");
} }
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!"); m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!");
} }
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!"); m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!");
} }
} }
catch (WebException e) catch (WebException e)
{ {
MainLog.Instance.Warn("GRID", "Error when trying to RemoveUserFriend: " + m_log.Warn("[GRID]: Error when trying to RemoveUserFriend: " +
e.Message); e.Message);
} }
@ -404,25 +406,24 @@ namespace OpenSim.Region.Communications.OGS1
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, User Server Reported an issue"); m_log.Warn("[GRID]: Unable to update_user_friend_perms, User Server Reported an issue");
} }
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!"); m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!");
} }
} }
else else
{ {
MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!"); m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!");
} }
} }
catch (WebException e) catch (WebException e)
{ {
MainLog.Instance.Warn("GRID", "Error when trying to update_user_friend_perms: " + m_log.Warn("[GRID]: Error when trying to update_user_friend_perms: " +
e.Message); e.Message);
} }
} }
/// <summary> /// <summary>
@ -452,12 +453,11 @@ namespace OpenSim.Region.Communications.OGS1
} }
catch (WebException e) catch (WebException e)
{ {
MainLog.Instance.Warn("Error when trying to fetch Avatar's friends list: " + m_log.Warn("Error when trying to fetch Avatar's friends list: " +
e.Message); e.Message);
// Return Empty list (no friends) // Return Empty list (no friends)
} }
return buddylist; return buddylist;
} }
#endregion #endregion

View File

@ -41,6 +41,8 @@ namespace OpenSim.Region.Environment
/// </summary> /// </summary>
public class EstateManager public class EstateManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene; private Scene m_scene;
private RegionInfo m_regInfo; private RegionInfo m_regInfo;
@ -156,7 +158,7 @@ namespace OpenSim.Region.Environment
{ {
case "getinfo": case "getinfo":
//MainLog.Instance.Verbose("ESTATE","CLIENT--->" + packet.ToString()); //m_log.Info("[ESTATE]: CLIENT--->" + packet.ToString());
sendRegionInfoPacketToAll(); sendRegionInfoPacketToAll();
if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
{ {
@ -223,7 +225,7 @@ namespace OpenSim.Region.Environment
} }
break; break;
default: default:
MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); m_log.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
break; break;
} }
} }
@ -283,7 +285,7 @@ namespace OpenSim.Region.Environment
returnblock[8].Parameter = Helpers.StringToField("1"); returnblock[8].Parameter = Helpers.StringToField("1");
packet.ParamList = returnblock; packet.ParamList = returnblock;
//MainLog.Instance.Verbose("ESTATE", "SIM--->" + packet.ToString()); //m_log.Info("[ESTATE]: SIM--->" + packet.ToString());
remote_client.OutPacket(packet, ThrottleOutPacketType.Task); remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
sendEstateManagerList(remote_client, packet); sendEstateManagerList(remote_client, packet);
@ -322,7 +324,7 @@ namespace OpenSim.Region.Environment
returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++; returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++;
} }
packet.ParamList = returnblock; packet.ParamList = returnblock;
//MainLog.Instance.Verbose("ESTATE", "SIM--->" + packet.ToString()); //m_log.Info("[ESTATE]: SIM--->" + packet.ToString());
remote_client.OutPacket(packet, ThrottleOutPacketType.Task); remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
} }
@ -364,10 +366,10 @@ namespace OpenSim.Region.Environment
default: default:
MainLog.Instance.Error("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta\n" + packet.ToString()); m_log.Error("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta\n" + packet.ToString());
break; break;
} }
//MainLog.Instance.Error("EstateOwnerMessage: estateAccessDelta\n" + packet.ToString()); //m_log.Error("EstateOwnerMessage: estateAccessDelta\n" + packet.ToString());
} }
@ -375,7 +377,7 @@ namespace OpenSim.Region.Environment
{ {
if (packet.ParamList.Length != 9) if (packet.ParamList.Length != 9)
{ {
MainLog.Instance.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length"); m_log.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length");
} }
else else
{ {
@ -438,7 +440,7 @@ namespace OpenSim.Region.Environment
{ {
if (packet.ParamList.Length != 9) if (packet.ParamList.Length != 9)
{ {
MainLog.Instance.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length"); m_log.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length");
} }
else else
{ {
@ -463,7 +465,7 @@ namespace OpenSim.Region.Environment
} }
catch (Exception ex) catch (Exception ex)
{ {
MainLog.Instance.Error("EstateManager: Exception while setting terrain settings: \n" + packet.ToString() + "\n" + ex.ToString()); m_log.Error("EstateManager: Exception while setting terrain settings: \n" + packet.ToString() + "\n" + ex.ToString());
} }
} }
} }

View File

@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Axiom.Math; using Axiom.Math;
@ -38,7 +39,6 @@ using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.Environment.LandManagement namespace OpenSim.Region.Environment.LandManagement
{ {
#region LandManager Class #region LandManager Class
/// <summary> /// <summary>
@ -46,6 +46,8 @@ namespace OpenSim.Region.Environment.LandManagement
/// </summary> /// </summary>
public class LandManager public class LandManager
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#region Constants #region Constants
//Land types set with flags in ParcelOverlay. //Land types set with flags in ParcelOverlay.
@ -57,7 +59,6 @@ namespace OpenSim.Region.Environment.LandManagement
public const byte LAND_TYPE_IS_FOR_SALE = (byte) 4; //Equals 00000100 public const byte LAND_TYPE_IS_FOR_SALE = (byte) 4; //Equals 00000100
public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte) 5; //Equals 00000101 public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte) 5; //Equals 00000101
//Flags that when set, a border on the given side will be placed //Flags that when set, a border on the given side will be placed
//NOTE: North and East is assumable by the west and south sides (if land to east has a west border, then I have an east border; etc) //NOTE: North and East is assumable by the west and south sides (if land to east has a west border, then I have an east border; etc)
//This took forever to figure out -- jeesh. /blame LL for even having to send these //This took forever to figure out -- jeesh. /blame LL for even having to send these
@ -73,7 +74,6 @@ namespace OpenSim.Region.Environment.LandManagement
public const int LAND_SELECT_OBJECTS_GROUP = 4; public const int LAND_SELECT_OBJECTS_GROUP = 4;
public const int LAND_SELECT_OBJECTS_OTHER = 8; public const int LAND_SELECT_OBJECTS_OTHER = 8;
//These are other constants. Yay! //These are other constants. Yay!
public const int START_LAND_LOCAL_ID = 1; public const int START_LAND_LOCAL_ID = 1;
@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.LandManagement
//} //}
//catch (Exception ex) //catch (Exception ex)
//{ //{
//MainLog.Instance.Error("LandManager", "IncomingLandObjectsFromStorage: Exception: " + ex.ToString()); //m_log.Error("[LandManager]: IncomingLandObjectsFromStorage: Exception: " + ex.ToString());
//throw ex; //throw ex;
//} //}
} }
@ -526,8 +526,7 @@ namespace OpenSim.Region.Environment.LandManagement
} }
catch (Exception e) catch (Exception e)
{ {
MainLog.Instance.Debug("LAND", m_log.Debug("[LAND]: Skipped Land checks because avatar is out of bounds: " + e.Message);
"Skipped Land checks because avatar is out of bounds: " + e.Message);
} }
} }
} }

View File

@ -40,16 +40,16 @@ namespace OpenSim.Region.Environment
{ {
public class ModuleLoader public class ModuleLoader
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public Dictionary<string, Assembly> LoadedAssemblys = new Dictionary<string, Assembly>(); public Dictionary<string, Assembly> LoadedAssemblys = new Dictionary<string, Assembly>();
private readonly List<IRegionModule> m_loadedModules = new List<IRegionModule>(); private readonly List<IRegionModule> m_loadedModules = new List<IRegionModule>();
private readonly Dictionary<string, IRegionModule> m_loadedSharedModules = new Dictionary<string, IRegionModule>(); private readonly Dictionary<string, IRegionModule> m_loadedSharedModules = new Dictionary<string, IRegionModule>();
private readonly LogBase m_log;
private readonly IConfigSource m_config; private readonly IConfigSource m_config;
public ModuleLoader(LogBase log, IConfigSource config) public ModuleLoader(IConfigSource config)
{ {
m_log = log;
m_config = config; m_config = config;
} }
@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment
DynamicTextureModule dynamicModule = new DynamicTextureModule(); DynamicTextureModule dynamicModule = new DynamicTextureModule();
if (m_loadedSharedModules.ContainsKey(dynamicModule.Name)) if (m_loadedSharedModules.ContainsKey(dynamicModule.Name))
{ {
m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"); m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"));
} }
else else
{ {
@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment
ChatModule chat = new ChatModule(); ChatModule chat = new ChatModule();
if (m_loadedSharedModules.ContainsKey(chat.Name)) if (m_loadedSharedModules.ContainsKey(chat.Name))
{ {
m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule"); m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule"));
} }
else else
{ {
@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment
InstantMessageModule imMod = new InstantMessageModule(); InstantMessageModule imMod = new InstantMessageModule();
if (m_loadedSharedModules.ContainsKey(imMod.Name)) if (m_loadedSharedModules.ContainsKey(imMod.Name))
{ {
m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule"); m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule"));
} }
else else
{ {
@ -108,7 +108,7 @@ namespace OpenSim.Region.Environment
LoadImageURLModule loadMod = new LoadImageURLModule(); LoadImageURLModule loadMod = new LoadImageURLModule();
if (m_loadedSharedModules.ContainsKey(loadMod.Name)) if (m_loadedSharedModules.ContainsKey(loadMod.Name))
{ {
m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule"); m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule"));
} }
else else
{ {
@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment
AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) if (m_loadedSharedModules.ContainsKey(avatarFactory.Name))
{ {
m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"));
} }
else else
{ {
@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment
XMLRPCModule xmlRpcMod = new XMLRPCModule(); XMLRPCModule xmlRpcMod = new XMLRPCModule();
if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name)) if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name))
{ {
m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule"); m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule"));
} }
else else
{ {
@ -186,17 +186,17 @@ namespace OpenSim.Region.Environment
if (modules.Length > 0) if (modules.Length > 0)
{ {
m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName); m_log.Info(String.Format("[MODULES]: Found Module Library [{0}]", dllName));
foreach (IRegionModule module in modules) foreach (IRegionModule module in modules)
{ {
if (!module.IsSharedModule) if (!module.IsSharedModule)
{ {
m_log.Verbose("MODULES", " [{0}]: Initializing.", module.Name); m_log.Info(String.Format("[MODULES]: [{0}]: Initializing.", module.Name));
InitializeModule(module, scene); InitializeModule(module, scene);
} }
else else
{ {
m_log.Verbose("MODULES", " [{0}]: Loading Shared Module.", module.Name); m_log.Info(String.Format("[MODULES]: [{0}]: Loading Shared Module.", module.Name));
LoadSharedModule(module); LoadSharedModule(module);
} }
} }
@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment
} }
catch (BadImageFormatException) catch (BadImageFormatException)
{ {
//m_log.Verbose("MODULES", "The file [{0}] is not a module assembly.", e.FileName); //m_log.Info(String.Format("[MODULES]: The file [{0}] is not a module assembly.", e.FileName));
} }
} }
@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment
} }
catch (ReflectionTypeLoadException) catch (ReflectionTypeLoadException)
{ {
m_log.Verbose("MODULES", "Could not load types for [{0}].", pluginAssembly.FullName); m_log.Info(String.Format("[MODULES]: Could not load types for [{0}].", pluginAssembly.FullName));
} }
} }

View File

@ -41,8 +41,7 @@ namespace OpenSim.Region.Environment.Modules
{ {
public class BetaGridLikeMoneyModule: IRegionModule public class BetaGridLikeMoneyModule: IRegionModule
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private LogBase m_log;
private Dictionary<ulong,Scene> m_scenel = new Dictionary<ulong,Scene>(); private Dictionary<ulong,Scene> m_scenel = new Dictionary<ulong,Scene>();
@ -66,8 +65,6 @@ namespace OpenSim.Region.Environment.Modules
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
m_log = MainLog.Instance;
m_gConfig = config; m_gConfig = config;
ReadConfigAndPopulate(); ReadConfigAndPopulate();
@ -160,11 +157,8 @@ namespace OpenSim.Region.Environment.Modules
} }
else else
{ {
MainLog.Instance.Warn("MONEY", "Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + e.sender.ToString() + " Reciver: " + e.reciever.ToString() + " Amount: " + e.amount.ToString()); m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + e.sender.ToString() + " Reciver: " + e.reciever.ToString() + " Amount: " + e.amount.ToString());
} }
} }
private bool doMoneyTranfer(LLUUID Sender, LLUUID Receiver, int amount) private bool doMoneyTranfer(LLUUID Sender, LLUUID Receiver, int amount)

View File

@ -43,8 +43,9 @@ namespace OpenSim.Region.Environment.Modules
{ {
public class ChatModule : IRegionModule, ISimChat public class ChatModule : IRegionModule, ISimChat
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private List<Scene> m_scenes = new List<Scene>(); private List<Scene> m_scenes = new List<Scene>();
private LogBase m_log;
private int m_whisperdistance = 10; private int m_whisperdistance = 10;
private int m_saydistance = 30; private int m_saydistance = 30;
@ -59,11 +60,6 @@ namespace OpenSim.Region.Environment.Modules
internal object m_syncLogout = new object(); internal object m_syncLogout = new object();
private Thread m_irc_connector=null; private Thread m_irc_connector=null;
public ChatModule()
{
m_log = MainLog.Instance;
}
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
lock (m_syncInit) lock (m_syncInit)
@ -159,7 +155,7 @@ namespace OpenSim.Region.Environment.Modules
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("IRC", "NewClient exception trap:" + ex.ToString()); m_log.Error("[IRC]: NewClient exception trap:" + ex.ToString());
} }
} }
@ -180,13 +176,13 @@ namespace OpenSim.Region.Environment.Modules
{ {
m_last_leaving_user = clientName; m_last_leaving_user = clientName;
m_irc.PrivMsg(m_irc.Nick, "Sim", "notices " + clientName + " left " + clientRegion); m_irc.PrivMsg(m_irc.Nick, "Sim", "notices " + clientName + " left " + clientRegion);
m_log.Verbose("IRC", "IRC watcher notices " + clientName + " left " + clientRegion); m_log.Info("[IRC]: IRC watcher notices " + clientName + " left " + clientRegion);
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("IRC", "ClientLoggedOut exception trap:" + ex.ToString()); m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex.ToString());
} }
} }
@ -319,6 +315,8 @@ namespace OpenSim.Region.Environment.Modules
internal class IRCChatModule internal class IRCChatModule
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private string m_server = null; private string m_server = null;
private uint m_port = 6668; private uint m_port = 6668;
private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
@ -341,7 +339,6 @@ namespace OpenSim.Region.Environment.Modules
private List<Scene> m_scenes = null; private List<Scene> m_scenes = null;
private List<Scene> m_last_scenes = null; private List<Scene> m_last_scenes = null;
private LogBase m_log;
public IRCChatModule(IConfigSource config) public IRCChatModule(IConfigSource config)
{ {
@ -388,9 +385,8 @@ namespace OpenSim.Region.Environment.Modules
} }
catch (Exception) catch (Exception)
{ {
MainLog.Instance.Verbose("CHAT", "No IRC config information, skipping IRC bridge configuration"); m_log.Info("[CHAT]: No IRC config information, skipping IRC bridge configuration");
} }
m_log = MainLog.Instance;
} }
public bool Connect(List<Scene> scenes) public bool Connect(List<Scene> scenes)
@ -404,9 +400,9 @@ namespace OpenSim.Region.Environment.Modules
if (m_last_scenes == null) { m_last_scenes = scenes; } if (m_last_scenes == null) { m_last_scenes = scenes; }
m_tcp = new TcpClient(m_server, (int)m_port); m_tcp = new TcpClient(m_server, (int)m_port);
m_log.Verbose("IRC", "Connecting..."); m_log.Info("[IRC]: Connecting...");
m_stream = m_tcp.GetStream(); m_stream = m_tcp.GetStream();
m_log.Verbose("IRC", "Connected to " + m_server); m_log.Info("[IRC]: Connected to " + m_server);
m_reader = new StreamReader(m_stream); m_reader = new StreamReader(m_stream);
m_writer = new StreamWriter(m_stream); m_writer = new StreamWriter(m_stream);
@ -422,7 +418,7 @@ namespace OpenSim.Region.Environment.Modules
m_writer.Flush(); m_writer.Flush();
m_writer.WriteLine("JOIN " + m_channel); m_writer.WriteLine("JOIN " + m_channel);
m_writer.Flush(); m_writer.Flush();
m_log.Verbose("IRC", "Connection fully established"); m_log.Info("[IRC]: Connection fully established");
m_connected = true; m_connected = true;
} }
catch (Exception e) catch (Exception e)
@ -475,16 +471,16 @@ namespace OpenSim.Region.Environment.Modules
m_writer.WriteLine(m_privmsgformat, m_channel, from, region, msg); m_writer.WriteLine(m_privmsgformat, m_channel, from, region, msg);
} }
m_writer.Flush(); m_writer.Flush();
m_log.Verbose("IRC", "PrivMsg " + from + " in " + region + " :" + msg); m_log.Info("[IRC]: PrivMsg " + from + " in " + region + " :" + msg);
} }
catch (IOException) catch (IOException)
{ {
m_log.Error("IRC", "Disconnected from IRC server.(PrivMsg)"); m_log.Error("[IRC]: Disconnected from IRC server.(PrivMsg)");
Reconnect(); Reconnect();
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("IRC", "PrivMsg exception trap:" + ex.ToString()); m_log.Error("[IRC]: PrivMsg exception trap:" + ex.ToString());
} }
} }
@ -493,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules
//examines IRC commands and extracts any private messages //examines IRC commands and extracts any private messages
// which will then be reboadcast in the Sim // which will then be reboadcast in the Sim
m_log.Verbose("IRC", "ExtractMsg: " + input); m_log.Info("[IRC]: ExtractMsg: " + input);
Dictionary<string, string> result = null; Dictionary<string, string> result = null;
//string regex = @":(?<nick>\w*)!~(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; //string regex = @":(?<nick>\w*)!~(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)";
string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)";
@ -510,10 +506,10 @@ namespace OpenSim.Region.Environment.Modules
} }
else else
{ {
m_log.Verbose("IRC", "Number of matches: " + matches.Count); m_log.Info("[IRC]: Number of matches: " + matches.Count);
if (matches.Count > 0) if (matches.Count > 0)
{ {
m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count); m_log.Info("[IRC]: Number of groups: " + matches[0].Groups.Count);
} }
} }
return result; return result;
@ -536,12 +532,12 @@ namespace OpenSim.Region.Environment.Modules
} }
catch (IOException) catch (IOException)
{ {
m_log.Error("IRC", "Disconnected from IRC server.(PingRun)"); m_log.Error("[IRC]: Disconnected from IRC server.(PingRun)");
Reconnect(); Reconnect();
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("IRC", "PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace); m_log.Error("[IRC]: PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
} }
} }
} }
@ -595,12 +591,12 @@ namespace OpenSim.Region.Environment.Modules
} }
catch (IOException) catch (IOException)
{ {
m_log.Error("IRC", "ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)"); m_log.Error("[IRC]: ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)");
Reconnect(); Reconnect();
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("IRC", "ListenerRun exception trap:" + ex.ToString()+"\n"+ex.StackTrace); m_log.Error("[IRC]: ListenerRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
} }
} }
} }
@ -626,27 +622,27 @@ namespace OpenSim.Region.Environment.Modules
} }
catch (Exception ex) // IRC gate should not crash Sim catch (Exception ex) // IRC gate should not crash Sim
{ {
m_log.Error("IRC", "BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace); m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace);
} }
} }
public enum ErrorReplies public enum ErrorReplies
{ {
NotRegistered = 451, // ":You have not registered" NotRegistered = 451, // ":You have not registered"
NicknameInUse = 433 // "<nick> :Nickname is already in use" NicknameInUse = 433 // "<nick> :Nickname is already in use"
} }
public enum Replies public enum Replies
{ {
MotdStart = 375, // ":- <server> Message of the day - " MotdStart = 375, // ":- <server> Message of the day - "
Motd = 372, // ":- <text>" Motd = 372, // ":- <text>"
EndOfMotd = 376 // ":End of /MOTD command" EndOfMotd = 376 // ":End of /MOTD command"
} }
public void ProcessIRCCommand(string command) public void ProcessIRCCommand(string command)
{ {
//m_log.Verbose("IRC", "ProcessIRCCommand:"+command); //m_log.Info("[IRC]: ProcessIRCCommand:" + command);
string[] commArgs = new string[command.Split(' ').Length]; string[] commArgs = new string[command.Split(' ').Length];
string c_server = m_server; string c_server = m_server;
@ -656,6 +652,7 @@ namespace OpenSim.Region.Environment.Modules
{ {
commArgs[0] = commArgs[0].Remove(0, 1); commArgs[0] = commArgs[0].Remove(0, 1);
} }
if (commArgs[1] == "002") if (commArgs[1] == "002")
{ {
// fetch the correct servername // fetch the correct servername
@ -668,7 +665,7 @@ namespace OpenSim.Region.Environment.Modules
if (commArgs[0] == "ERROR") if (commArgs[0] == "ERROR")
{ {
m_log.Error("IRC", "IRC SERVER ERROR:" + command); m_log.Error("[IRC]: IRC SERVER ERROR:" + command);
} }
if (commArgs[0] == "PING") if (commArgs[0] == "PING")
@ -695,7 +692,7 @@ namespace OpenSim.Region.Environment.Modules
case (int)ErrorReplies.NicknameInUse: case (int)ErrorReplies.NicknameInUse:
// Gen a new name // Gen a new name
m_nick = m_basenick + Util.RandomClass.Next(1, 99); m_nick = m_basenick + Util.RandomClass.Next(1, 99);
m_log.Error("IRC", "IRC SERVER reports NicknameInUse, trying " + m_nick); m_log.Error("[IRC]: IRC SERVER reports NicknameInUse, trying " + m_nick);
// Retry // Retry
m_writer.WriteLine("NICK " + m_nick); m_writer.WriteLine("NICK " + m_nick);
m_writer.Flush(); m_writer.Flush();

View File

@ -40,8 +40,7 @@ namespace OpenSim.Region.Environment.Modules
{ {
public class FriendsModule : IRegionModule public class FriendsModule : IRegionModule
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private LogBase m_log;
private Scene m_scene; private Scene m_scene;
@ -49,7 +48,6 @@ namespace OpenSim.Region.Environment.Modules
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
m_log = MainLog.Instance;
m_scene = scene; m_scene = scene;
scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage; scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage;
@ -72,6 +70,7 @@ namespace OpenSim.Region.Environment.Modules
} }
private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID, private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID,
LLUUID fromAgentSession, LLUUID toAgentID, LLUUID fromAgentSession, LLUUID toAgentID,
LLUUID imSessionID, uint timestamp, string fromAgentName, LLUUID imSessionID, uint timestamp, string fromAgentName,
@ -89,13 +88,13 @@ namespace OpenSim.Region.Environment.Modules
m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); m_pendingFriendRequests.Add(friendTransactionID, fromAgentID);
m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
GridInstantMessage msg = new GridInstantMessage(); GridInstantMessage msg = new GridInstantMessage();
msg.fromAgentID = fromAgentID.UUID; msg.fromAgentID = fromAgentID.UUID;
msg.fromAgentSession = fromAgentSession.UUID; msg.fromAgentSession = fromAgentSession.UUID;
msg.toAgentID = toAgentID.UUID; msg.toAgentID = toAgentID.UUID;
msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here
m_log.Verbose("FRIEND","Filling Session: " + msg.imSessionID.ToString()); m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString());
msg.timestamp = timestamp; msg.timestamp = timestamp;
if (client != null) if (client != null)
{ {
@ -115,20 +114,18 @@ namespace OpenSim.Region.Environment.Modules
msg.binaryBucket = binaryBucket; msg.binaryBucket = binaryBucket;
m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
} }
if (dialog == (byte)39)
{
m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
}
if (dialog == (byte)40)
{
m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
}
// 39 == Accept Friendship // 39 == Accept Friendship
if (dialog == (byte)39)
{
m_log.Info("[FRIEND]: 39 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
}
// 40 == Decline Friendship // 40 == Decline Friendship
if (dialog == (byte)40)
{
m_log.Info("[FRIEND]: 40 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
}
} }
private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders) private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders)
@ -160,6 +157,7 @@ namespace OpenSim.Region.Environment.Modules
// TODO: Inform agent that the friend is online // TODO: Inform agent that the friend is online
} }
} }
private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders) private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders)
{ {
if (m_pendingFriendRequests.ContainsKey(transactionID)) if (m_pendingFriendRequests.ContainsKey(transactionID))
@ -184,20 +182,15 @@ namespace OpenSim.Region.Environment.Modules
msg.binaryBucket = new byte[0]; msg.binaryBucket = new byte[0];
m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
m_pendingFriendRequests.Remove(transactionID); m_pendingFriendRequests.Remove(transactionID);
} }
} }
private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID) private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID)
{ {
m_scene.StoreRemoveFriendship(agent, exfriendID); m_scene.StoreRemoveFriendship(agent, exfriendID);
// TODO: Inform the client that the ExFriend is offline // TODO: Inform the client that the ExFriend is offline
} }
private void OnGridInstantMessage(GridInstantMessage msg) private void OnGridInstantMessage(GridInstantMessage msg)
{ {
// Trigger the above event handler // Trigger the above event handler
@ -206,16 +199,12 @@ namespace OpenSim.Region.Environment.Modules
msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID,
new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID),
msg.binaryBucket); msg.binaryBucket);
} }
public void PostInitialise() public void PostInitialise()
{ {
} }
public void Close() public void Close()
{ {
} }

View File

@ -39,12 +39,6 @@ namespace OpenSim.Region.Environment.Modules
public class InstantMessageModule : IRegionModule public class InstantMessageModule : IRegionModule
{ {
private List<Scene> m_scenes = new List<Scene>(); private List<Scene> m_scenes = new List<Scene>();
private LogBase m_log;
public InstantMessageModule()
{
m_log = MainLog.Instance;
}
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
@ -68,7 +62,6 @@ namespace OpenSim.Region.Environment.Modules
uint ParentEstateID, LLVector3 Position, LLUUID RegionID, uint ParentEstateID, LLVector3 Position, LLUUID RegionID,
byte[] binaryBucket) byte[] binaryBucket)
{ {
bool FriendDialog = ((dialog == (byte)38) || (dialog == (byte)39) || (dialog == (byte)40)); bool FriendDialog = ((dialog == (byte)38) || (dialog == (byte)39) || (dialog == (byte)40));
// IM dialogs need to be pre-processed and have their sessionID filled by the server // IM dialogs need to be pre-processed and have their sessionID filled by the server

View File

@ -39,6 +39,8 @@ namespace OpenSim.Region.Environment.Modules
{ {
public class SunModule : IRegionModule public class SunModule : IRegionModule
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const double m_real_day = 24.0; private const double m_real_day = 24.0;
private const int m_default_frame = 100; private const int m_default_frame = 100;
private int m_frame_mod; private int m_frame_mod;
@ -48,7 +50,6 @@ namespace OpenSim.Region.Environment.Modules
private long m_start; private long m_start;
private Scene m_scene; private Scene m_scene;
private LogBase m_log;
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
@ -69,7 +70,6 @@ namespace OpenSim.Region.Environment.Modules
m_dilation = (int) (m_real_day/m_day_length); m_dilation = (int) (m_real_day/m_day_length);
m_scene = scene; m_scene = scene;
m_log = MainLog.Instance;
scene.EventManager.OnFrame += SunUpdate; scene.EventManager.OnFrame += SunUpdate;
scene.EventManager.OnNewClient += SunToClient; scene.EventManager.OnNewClient += SunToClient;
} }
@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Modules
m_frame++; m_frame++;
return; return;
} }
// m_log.Verbose("SUN","I've got an update {0} => {1}", m_scene.RegionsInfo.RegionName, HourOfTheDay()); // m_log.Info("[SUN]: I've got an update {0} => {1}", m_scene.RegionsInfo.RegionName, HourOfTheDay());
List<ScenePresence> avatars = m_scene.GetAvatars(); List<ScenePresence> avatars = m_scene.GetAvatars();
foreach (ScenePresence avatar in avatars) foreach (ScenePresence avatar in avatars)
{ {

View File

@ -36,6 +36,8 @@ namespace OpenSim.Region.Environment.Modules
{ {
public class TextureSender public class TextureSender
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public int counter = 0; public int counter = 0;
private AssetBase m_asset; private AssetBase m_asset;
public long DataPointer = 0; public long DataPointer = 0;
@ -135,8 +137,7 @@ namespace OpenSim.Region.Environment.Modules
} }
catch (ArgumentOutOfRangeException) catch (ArgumentOutOfRangeException)
{ {
MainLog.Instance.Error("TEXTURE", m_log.Error("[TEXTURE]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
"Unable to separate texture into multiple packets: Array bounds failure on asset:" +
m_asset.FullID.ToString() ); m_asset.FullID.ToString() );
return; return;
} }

View File

@ -75,6 +75,8 @@ namespace OpenSim.Region.Environment.Modules
{ {
public class XMLRPCModule : IRegionModule, IXMLRPC public class XMLRPCModule : IRegionModule, IXMLRPC
{ {
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene; private Scene m_scene;
private Queue<RPCRequestInfo> rpcQueue = new Queue<RPCRequestInfo>(); private Queue<RPCRequestInfo> rpcQueue = new Queue<RPCRequestInfo>();
private object XMLRPCListLock = new object(); private object XMLRPCListLock = new object();
@ -83,7 +85,6 @@ namespace OpenSim.Region.Environment.Modules
private int RemoteReplyScriptTimeout = 900; private int RemoteReplyScriptTimeout = 900;
private int m_remoteDataPort = 0; private int m_remoteDataPort = 0;
private List<Scene> m_scenes = new List<Scene>(); private List<Scene> m_scenes = new List<Scene>();
private LogBase m_log;
// <channel id, RPCChannelInfo> // <channel id, RPCChannelInfo>
private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; private Dictionary<LLUUID, RPCChannelInfo> m_openChannels;
@ -91,11 +92,6 @@ namespace OpenSim.Region.Environment.Modules
// <channel id, RPCRequestInfo> // <channel id, RPCRequestInfo>
private Dictionary<LLUUID, RPCRequestInfo> m_pendingResponse; private Dictionary<LLUUID, RPCRequestInfo> m_pendingResponse;
public XMLRPCModule()
{
m_log = MainLog.Instance;
}
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
try try
@ -123,7 +119,7 @@ namespace OpenSim.Region.Environment.Modules
// Start http server // Start http server
// Attach xmlrpc handlers // Attach xmlrpc handlers
m_log.Verbose("REMOTE_DATA", m_log.Info("[REMOTE_DATA]: " +
"Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort);
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);

Some files were not shown because too many files have changed in this diff Show More