From 379ac9c92ac2cdaf9ad4cc1e66de243a42ae7c42 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 15 Apr 2008 22:41:34 +0000 Subject: * Make it easier to follow logins on the user server by changing and tidying up log messages --- OpenSim/Data/MySQL/MySQLManager.cs | 4 +-- OpenSim/Framework/Communications/LoginService.cs | 40 ++++++++++++---------- OpenSim/Grid/UserServer/MessageServersConnector.cs | 14 ++++---- OpenSim/Grid/UserServer/UserLoginService.cs | 6 ++-- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 38f56c4..a122954 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -660,7 +660,7 @@ namespace OpenSim.Data.MySQL return false; } - m_log.Debug("[MySQLManager]: Fetch user retval == " + returnval.ToString()); + //m_log.Debug("[MySQLManager]: Fetch user retval == " + returnval.ToString()); return returnval; } @@ -750,7 +750,7 @@ namespace OpenSim.Data.MySQL return false; } - m_log.Debug("[MySQLManager]: update user retval == " + returnval.ToString()); + //m_log.Debug("[MySQLManager]: update user retval == " + returnval.ToString()); return returnval; } diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index f8ac75e..d610c51 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -121,25 +121,28 @@ namespace OpenSim.Framework.UserManagement lastname = (string) requestData["last"]; m_log.InfoFormat( - "[LOGIN]: Received login request message from user {0} {1}", + "[LOGIN BEGIN]: Received login request message from user {0} {1}", firstname, lastname); - if( requestData.Contains("version")) + string clientVersion = "Unknown"; + + if (requestData.Contains("version")) { - string clientversion = (string)requestData["version"]; - m_log.Info("[LOGIN]: Client version: " + clientversion); + clientVersion = (string)requestData["version"]; } if (requestData.Contains("start")) { startLocationRequest = (string)requestData["start"]; - m_log.Info("[LOGIN]: Client requested start location: " + (string)requestData["start"]); } + + m_log.DebugFormat( + "[LOGIN]: Client is {0}, start location is {1}", clientVersion, startLocationRequest); userProfile = GetTheUser(firstname, lastname); if (userProfile == null) { - m_log.Info("[LOGIN]: Could not find a profile for " + firstname + " " + lastname); + m_log.Info("[LOGIN END]: Could not find a profile for " + firstname + " " + lastname); return logResponse.CreateLoginFailedResponse(); } @@ -159,7 +162,7 @@ namespace OpenSim.Framework.UserManagement catch (System.Exception e) { m_log.InfoFormat( - "[LOGIN]: Bad web_login_key: {0} for user {1} {2}, exception {3}", + "[LOGIN END]: Bad web_login_key: {0} for user {1} {2}, exception {3}", requestData["web_login_key"], firstname, lastname, e); return logResponse.CreateFailedResponse(); @@ -171,14 +174,14 @@ namespace OpenSim.Framework.UserManagement else { m_log.Info( - "[LOGIN]: login_to_simulator login message did not contain all the required data"); + "[LOGIN END]: login_to_simulator login message did not contain all the required data"); return logResponse.CreateGridErrorResponse(); } if (!GoodLogin) { - m_log.InfoFormat("[LOGIN]: User {0} {1} failed authentication", firstname, lastname); + m_log.InfoFormat("[LOGIN END]: User {0} {1} failed authentication", firstname, lastname); return logResponse.CreateLoginFailedResponse(); } @@ -197,7 +200,7 @@ namespace OpenSim.Framework.UserManagement // Reject the login m_log.InfoFormat( - "[LOGIN]: Notifying user {0} {1} that they are already logged in", + "[LOGIN END]: Notifying user {0} {1} that they are already logged in", firstname, lastname); return logResponse.CreateAlreadyLoggedInResponse(); @@ -218,8 +221,9 @@ namespace OpenSim.Framework.UserManagement catch (System.Net.WebException e) { m_log.ErrorFormat( - "[LOGIN]: Error retrieving inventory skeleton of agent {0}, {1} - {2}", agentID, e.GetType(), e.Message); - + "[LOGIN END]: Error retrieving inventory skeleton of agent {0}, {1} - {2}", + agentID, e.GetType(), e.Message); + return logResponse.CreateLoginInventoryFailedResponse(); } @@ -269,7 +273,7 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - m_log.Info("[LOGIN]: " + e.ToString()); + m_log.Info("[LOGIN END]: " + e.ToString()); return logResponse.CreateDeadRegionResponse(); //return logResponse.ToXmlRpcResponse(); } @@ -279,19 +283,19 @@ namespace OpenSim.Framework.UserManagement if (StatsManager.UserStats != null) StatsManager.UserStats.AddSuccessfulLogin(); - m_log.InfoFormat( - "[LOGIN]: Authentication of user {0} {1} successful. Sending response to client.", + m_log.DebugFormat( + "[LOGIN END]: Authentication of user {0} {1} successful. Sending response to client.", firstname, lastname); return logResponse.ToXmlRpcResponse(); } catch (Exception e) { - m_log.Info("[LOGIN]: Login failed, " + e.ToString()); + m_log.Info("[LOGIN END]: Login failed, " + e.ToString()); } } - m_log.Info("[LOGIN]: Login failed. Sending back blank XMLRPC response"); + m_log.Info("[LOGIN END]: Login failed. Sending back blank XMLRPC response"); return response; } finally @@ -654,7 +658,7 @@ namespace OpenSim.Framework.UserManagement public virtual bool AuthenticateUser(UserProfileData profile, string password) { bool passwordSuccess = false; - m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.ID); + //m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.ID); // Web Login method seems to also occasionally send the hashed password itself diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs index b125a0d..6355c4d 100644 --- a/OpenSim/Grid/UserServer/MessageServersConnector.cs +++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs @@ -169,10 +169,10 @@ namespace OpenSim.Grid.UserServer { m_log.Info("[MSGCONNECTOR]: Sending login notice to registered message servers"); } - else - { - m_log.Info("[MSGCONNECTOR]: No Message Servers registered, ignoring"); - } +// else +// { +// m_log.Debug("[MSGCONNECTOR]: No Message Servers registered, ignoring"); +// } foreach (MessageServerInfo serv in MessageServers.Values) { NotifyMessageServerAboutUser(serv, agentID, sessionID, RegionID, @@ -191,9 +191,9 @@ namespace OpenSim.Grid.UserServer m_log.Info("[MSGCONNECTOR]: Sending login notice to registered message servers"); } else - { - m_log.Info("[MSGCONNECTOR]: No Message Servers registered, ignoring"); - } +// { +// m_log.Debug("[MSGCONNECTOR]: No Message Servers registered, ignoring"); +// } foreach (MessageServerInfo serv in MessageServers.Values) { NotifyMessageServerAboutUserLogoff(serv,agentID); diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index c07777e..d1d97f8 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -204,7 +204,7 @@ namespace OpenSim.Grid.UserServer handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; if (handlerUserLoggedInAtLocation != null) { - m_log.Info("[LOGIN]: Letting other objects know about login"); + //m_log.Info("[LOGIN]: Letting other objects know about login"); handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X,theUser.CurrentAgent.Position.Y,theUser.CurrentAgent.Position.Z, theUser.FirstName,theUser.SurName); @@ -302,7 +302,9 @@ namespace OpenSim.Grid.UserServer // See LoginService protected override InventoryData GetInventorySkeleton(LLUUID userID) { - m_log.InfoFormat("[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}", m_config.InventoryUrl, userID); + m_log.DebugFormat( + "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}", + m_config.InventoryUrl, userID); List folders = SynchronousRestObjectPoster.BeginPostObject>( -- cgit v1.1