From db9616f7baa45fc15a9afded024655d4ad442556 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 5 Jul 2012 21:30:20 +0100 Subject: [PATCH] minor: add client name to various login service log messages to disambiguate messages from concurrent logins. Also adds destination resolution debug log message showing region endpoint. Adding endpoint to the log helps to find issues where the region external host information has been wrongly configured --- .../Services/LLLoginService/LLLoginService.cs | 56 ++++++++++++++----- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 9acba114da..495dc5297c 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -257,7 +257,9 @@ namespace OpenSim.Services.LLLoginService if (!am.Success) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client {0} is not allowed", clientVersion); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: client {2} is not allowed", + firstName, lastName, clientVersion); return LLFailedLoginResponse.LoginBlockedProblem; } } @@ -269,7 +271,9 @@ namespace OpenSim.Services.LLLoginService if (dm.Success) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client {0} is denied", clientVersion); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: client {2} is denied", + firstName, lastName, clientVersion); return LLFailedLoginResponse.LoginBlockedProblem; } } @@ -280,13 +284,16 @@ namespace OpenSim.Services.LLLoginService UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); if (account == null) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: user not found"); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: user not found", firstName, lastName); return LLFailedLoginResponse.UserProblem; } if (account.UserLevel < m_MinLoginLevel) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: user level is {2} but minimum login level is {3}", + firstName, lastName, m_MinLoginLevel, account.UserLevel); return LLFailedLoginResponse.LoginBlockedProblem; } @@ -297,7 +304,8 @@ namespace OpenSim.Services.LLLoginService { if (account.ScopeID != scopeID && account.ScopeID != UUID.Zero) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: user not found"); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed, reason: user {0} {1} not found", firstName, lastName); return LLFailedLoginResponse.UserProblem; } } @@ -316,7 +324,9 @@ namespace OpenSim.Services.LLLoginService UUID secureSession = UUID.Zero; if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: authentication failed"); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: authentication failed", + firstName, lastName); return LLFailedLoginResponse.UserProblem; } @@ -325,13 +335,18 @@ namespace OpenSim.Services.LLLoginService // if (m_RequireInventory && m_InventoryService == null) { - m_log.WarnFormat("[LLOGIN SERVICE]: Login failed, reason: inventory service not set up"); + m_log.WarnFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: inventory service not set up", + firstName, lastName); return LLFailedLoginResponse.InventoryProblem; } + List inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: unable to retrieve user inventory"); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed, for {0} {1}, reason: unable to retrieve user inventory", + firstName, lastName); return LLFailedLoginResponse.InventoryProblem; } @@ -345,9 +360,12 @@ namespace OpenSim.Services.LLLoginService if (m_PresenceService != null) { success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession); + if (!success) { - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: could not login presence"); + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: could not login presence", + firstName, lastName); return LLFailedLoginResponse.GridProblem; } } @@ -380,9 +398,18 @@ namespace OpenSim.Services.LLLoginService if (destination == null) { m_PresenceService.LogoutAgent(session); - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: destination not found"); + + m_log.InfoFormat( + "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: destination not found", + firstName, lastName); return LLFailedLoginResponse.GridProblem; } + else + { + m_log.DebugFormat( + "[LLOGIN SERVICE]: Found destination {0}, endpoint {1} for {2} {3}", + destination.RegionName, destination.ExternalEndPoint, firstName, lastName); + } if (account.UserLevel >= 200) flags |= TeleportFlags.Godlike; @@ -406,7 +433,7 @@ namespace OpenSim.Services.LLLoginService if (aCircuit == null) { m_PresenceService.LogoutAgent(session); - m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason); + m_log.InfoFormat("[LLOGIN SERVICE]: Login failed for {0} {1}, reason: {2}", firstName, lastName, reason); return new LLFailedLoginResponse("key", reason, "false"); } @@ -427,7 +454,8 @@ namespace OpenSim.Services.LLLoginService where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone); - m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); + m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); + return response; } catch (Exception e) @@ -446,7 +474,9 @@ namespace OpenSim.Services.LLLoginService { flags = TeleportFlags.ViaLogin; - m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); + m_log.DebugFormat( + "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}", + startLocation, account.Name); gatekeeper = null; where = "home";