From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 Feb 2008 19:44:27 +0000 Subject: Converted logging to use log4net. Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done. --- OpenSim/Framework/Data.MySQL/MySQLAssetData.cs | 18 +++--- OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 74 +++++++++++----------- OpenSim/Framework/Data.MySQL/MySQLGridData.cs | 14 ++-- OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs | 34 +++++----- OpenSim/Framework/Data.MySQL/MySQLManager.cs | 18 +++--- OpenSim/Framework/Data.MySQL/MySQLUserData.cs | 28 ++++---- 6 files changed, 99 insertions(+), 87 deletions(-) (limited to 'OpenSim/Framework/Data.MySQL') diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs index 407d6d2..f9ef699 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs @@ -37,6 +37,8 @@ namespace OpenSim.Framework.Data.MySQL { internal class MySQLAssetData : IAssetProvider { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private MySQLManager _dbConnection; #region IAssetProvider Members @@ -46,7 +48,7 @@ namespace OpenSim.Framework.Data.MySQL // null as the version, indicates that the table didn't exist if (oldVersion == null) { - MainLog.Instance.Notice("ASSETS", "Creating new database tables"); + m_log.Info("[ASSETS]: Creating new database tables"); _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql"); return; } @@ -98,9 +100,9 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error( - "ASSETS", "MySql failure fetching asset {0}" + Environment.NewLine + e.ToString() - + Environment.NewLine + "Attempting reconnection", assetID); + m_log.Error(String.Format( + "[ASSETS]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString() + + Environment.NewLine + "Attempting reconnection", assetID)); _dbConnection.Reconnect(); } } @@ -137,10 +139,10 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error( - "ASSETS", - "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() - + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); + m_log.Error(String.Format( + "[ASSETS]: " + + "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() + + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name)); _dbConnection.Reconnect(); } } diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 54f39bb..e2ea018 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs @@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MySQL { 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_shapeSelect = "select * from primshapes"; private const string m_itemsSelect = "select * from primitems"; @@ -80,7 +82,7 @@ namespace OpenSim.Framework.Data.MySQL m_dataSet = new DataSet(); this.persistPrimInventories = persistPrimInventories; - MainLog.Instance.Verbose("DATASTORE", "MySql - connecting: " + connectionstring); + m_log.Info("[DATASTORE]: MySql - connecting: " + connectionstring); m_connection = new MySqlConnection(connectionstring); 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) { - 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); } 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) { - 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 shapes = m_shapeTable; @@ -228,7 +230,7 @@ namespace OpenSim.Framework.Data.MySQL lock (m_dataSet) { DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); - MainLog.Instance.Verbose("DATASTORE", + m_log.Info("[DATASTORE]: " + "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); foreach (DataRow primRow in primsForRegion) @@ -251,7 +253,7 @@ namespace OpenSim.Framework.Data.MySQL } else { - MainLog.Instance.Notice( + m_log.Info( "No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } @@ -270,7 +272,7 @@ namespace OpenSim.Framework.Data.MySQL } else { - MainLog.Instance.Notice( + m_log.Info( "No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } @@ -284,11 +286,11 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error("DATASTORE", "Failed create prim object, exception and data follows"); - MainLog.Instance.Verbose("DATASTORE", e.ToString()); + m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows"); + m_log.Info("[DATASTORE]: " + e.ToString()); 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 /// 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; @@ -316,7 +318,7 @@ namespace OpenSim.Framework.Data.MySQL TaskInventoryItem item = buildItem(row); 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); @@ -332,7 +334,7 @@ namespace OpenSim.Framework.Data.MySQL public void StoreTerrain(double[,] ter, LLUUID regionID) { 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"]; lock (m_dataSet) @@ -384,11 +386,11 @@ namespace OpenSim.Framework.Data.MySQL } else { - MainLog.Instance.Verbose("DATASTORE", "No terrain found for region"); + m_log.Info("[DATASTORE]: No terrain found for region"); return null; } - MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString()); + m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString()); } return terret; @@ -418,7 +420,7 @@ namespace OpenSim.Framework.Data.MySQL public void StoreLandObject(Land parcel, LLUUID regionUUID) { // 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)); lock (m_dataSet) @@ -1214,7 +1216,7 @@ namespace OpenSim.Framework.Data.MySQL if (!persistPrimInventories) 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 // 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 foreach (TaskInventoryItem newItem in items) { -// MainLog.Instance.Verbose( -// "DATASTORE", -// "Adding item {0}, {1} to prim ID {2}", -// newItem.Name, newItem.ItemID, newItem.ParentPartID); +// m_log.Info(String.Format( +// "[DATASTORE]: " + +// "Adding item {0}, {1} to prim ID {2}", +// newItem.Name, newItem.ItemID, newItem.ParentPartID)); DataRow newItemRow = m_itemsTable.NewRow(); fillItemRow(newItemRow, newItem); @@ -1332,7 +1334,7 @@ namespace OpenSim.Framework.Data.MySQL sql += subsql; sql += ")"; - //MainLog.Instance.Verbose("DATASTORE", "defineTable() sql {0}", sql); + //m_log.Info(String.Format("[DATASTORE]: defineTable() sql {0}", sql)); return sql; } @@ -1463,8 +1465,8 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception ex) { - MainLog.Instance.Error("MySql", "Error connecting to MySQL server: " + ex.Message); - MainLog.Instance.Error("MySql", "Application is terminating!"); + m_log.Error("[MySql]: Error connecting to MySQL server: " + ex.Message); + m_log.Error("[MySql]: Application is terminating!"); System.Threading.Thread.CurrentThread.Abort(); } } @@ -1475,7 +1477,7 @@ namespace OpenSim.Framework.Data.MySQL } 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 @@ -1484,7 +1486,7 @@ namespace OpenSim.Framework.Data.MySQL } 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 @@ -1493,7 +1495,7 @@ namespace OpenSim.Framework.Data.MySQL } 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 @@ -1502,7 +1504,7 @@ namespace OpenSim.Framework.Data.MySQL } 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 @@ -1511,7 +1513,7 @@ namespace OpenSim.Framework.Data.MySQL } 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 @@ -1520,7 +1522,7 @@ namespace OpenSim.Framework.Data.MySQL } 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(); } @@ -1555,7 +1557,7 @@ namespace OpenSim.Framework.Data.MySQL } catch (MySqlException) { - MainLog.Instance.Verbose("DATASTORE", "MySql Database doesn't exist... creating"); + m_log.Info("[DATASTORE]: MySql Database doesn't exist... creating"); InitDB(conn); } @@ -1573,7 +1575,7 @@ namespace OpenSim.Framework.Data.MySQL { 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; } } @@ -1582,7 +1584,7 @@ namespace OpenSim.Framework.Data.MySQL { 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; } } @@ -1593,7 +1595,7 @@ namespace OpenSim.Framework.Data.MySQL { 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; } } @@ -1602,7 +1604,7 @@ namespace OpenSim.Framework.Data.MySQL { 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; } } @@ -1611,7 +1613,7 @@ namespace OpenSim.Framework.Data.MySQL { 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; } } diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs index c8c4ab0..d62c286 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs @@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MySQL /// public class MySQLGridData : IGridData { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + /// /// MySQL Database Manager /// @@ -168,7 +170,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -200,7 +202,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -247,7 +249,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return returnlist; } } @@ -282,7 +284,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return returnlist; } } @@ -316,7 +318,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -405,7 +407,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs index c317f4a..57c2c9f 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs @@ -38,6 +38,8 @@ namespace OpenSim.Framework.Data.MySQL /// public class MySQLInventoryData : IInventoryData { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + /// /// The database manager /// @@ -104,8 +106,8 @@ namespace OpenSim.Framework.Data.MySQL tableList["inventoryitems"] = null; database.GetTableVersion(tableList); - MainLog.Instance.Verbose("MYSQL", "Inventory Folder Version: " + tableList["inventoryfolders"]); - MainLog.Instance.Verbose("MYSQL", "Inventory Items Version: " + tableList["inventoryitems"]); + m_log.Info("[MYSQL]: Inventory Folder Version: " + tableList["inventoryfolders"]); + m_log.Info("[MYSQL]: Inventory Items Version: " + tableList["inventoryitems"]); UpgradeFoldersTable(tableList["inventoryfolders"]); UpgradeItemsTable(tableList["inventoryitems"]); @@ -170,7 +172,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -208,7 +210,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -254,7 +256,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -292,7 +294,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -325,7 +327,7 @@ namespace OpenSim.Framework.Data.MySQL } catch (MySqlException e) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } return null; @@ -362,7 +364,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } return null; } @@ -387,7 +389,7 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } return null; @@ -421,7 +423,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -459,7 +461,7 @@ namespace OpenSim.Framework.Data.MySQL } 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) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } } @@ -516,7 +518,7 @@ namespace OpenSim.Framework.Data.MySQL } 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) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } } @@ -593,7 +595,7 @@ namespace OpenSim.Framework.Data.MySQL catch (MySqlException e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } } @@ -609,7 +611,7 @@ namespace OpenSim.Framework.Data.MySQL catch (MySqlException e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } } diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs index 3df0242..f70b505 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs @@ -42,6 +42,8 @@ namespace OpenSim.Framework.Data.MySQL /// internal class MySQLManager { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + /// /// The database connection object /// @@ -71,7 +73,7 @@ namespace OpenSim.Framework.Data.MySQL dbcon.Open(); - MainLog.Instance.Verbose("MYSQL", "Connection established"); + m_log.Info("[MYSQL]: Connection established"); } catch (Exception e) { @@ -113,7 +115,7 @@ namespace OpenSim.Framework.Data.MySQL } 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) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } } tables.Close(); @@ -245,7 +247,7 @@ namespace OpenSim.Framework.Data.MySQL } 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 @@ -263,7 +265,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { // 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; } } @@ -523,7 +525,7 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return false; } @@ -617,7 +619,7 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return false; } @@ -726,7 +728,7 @@ namespace OpenSim.Framework.Data.MySQL } catch (Exception e) { - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return false; } diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs index 2ee20e0..0db727c 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs @@ -39,6 +39,8 @@ namespace OpenSim.Framework.Data.MySQL /// internal class MySQLUserData : IUserData { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + /// /// Database manager for MySQL /// @@ -119,7 +121,7 @@ namespace OpenSim.Framework.Data.MySQL database.ExecuteResourceSql("UpgradeUsersTableToVersion2.sql"); return; } - //MainLog.Instance.Verbose("DB","DBVers:" + oldVersion); + //m_log.Info("[DB]: DBVers:" + oldVersion); } /// @@ -164,7 +166,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -208,7 +210,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return; } } @@ -243,7 +245,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return; } } @@ -272,7 +274,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return; } } @@ -317,7 +319,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return Lfli; } @@ -328,7 +330,7 @@ namespace OpenSim.Framework.Data.MySQL 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) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return returnlist; } } @@ -406,7 +408,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return returnlist; } } @@ -437,7 +439,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -488,7 +490,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return; } @@ -525,7 +527,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); return null; } } @@ -553,7 +555,7 @@ namespace OpenSim.Framework.Data.MySQL catch (Exception e) { database.Reconnect(); - MainLog.Instance.Error(e.ToString()); + m_log.Error(e.ToString()); } } -- cgit v1.1