Skip to content

Commit

Permalink
Improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyts committed Mar 12, 2022
1 parent 8a80736 commit 2991a59
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion SelfServiceSessionReset/Controllers/CtxSessionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,9 +1202,20 @@ public IEnumerable<CtxSession> GetSessions(string sitename, string deliverycontr
{
break;
}
else
{
deliverycontroller = string.Empty;
}
}
string username = GetLoggedOnUser();
Log.Information("Getting sessions for " + username + " from the " + sitename + " Site using the " + deliverycontroller + " Delivery Controller.");
if (!string.IsNullOrEmpty(deliverycontroller))
{
Log.Information("Getting sessions for " + username + " from the " + sitename + " Site using the " + deliverycontroller + " Delivery Controller.");
}
else
{
Log.Information("No healthy Delivery Controllers can be found.");
}
return GetCurrentSessions(sitename, deliverycontroller, username);
}

Expand All @@ -1231,6 +1242,10 @@ public IEnumerable<CtxSession> GetSession(string machinename, string sitename, s
{
break;
}
else
{
deliverycontroller = string.Empty;
}
}
string username = GetLoggedOnUser();
Log.Information("Getting the session running on" + machinename + " for " + username + " from the " + sitename + " Site using the " + deliverycontroller + " Delivery Controller.");
Expand Down Expand Up @@ -1276,6 +1291,10 @@ public IHttpActionResult LogoffSessionsByMachineName([FromBody]CtxSessionsToActi
{
break;
}
else
{
deliverycontroller = string.Empty;
}
}
string username = GetLoggedOnUser();
string[] machinearray = logoffinfo.MachineNames.ToArray();
Expand Down Expand Up @@ -1347,6 +1366,10 @@ public IHttpActionResult DisconnectSessionsByMachineName([FromBody]CtxSessionsTo
{
break;
}
else
{
deliverycontroller = string.Empty;
}
}
string username = GetLoggedOnUser();
string[] machinearray = disconnectinfo.MachineNames.ToArray();
Expand Down Expand Up @@ -1429,6 +1452,10 @@ public IHttpActionResult RestartMachinesByMachineName([FromBody]CtxSessionsToAct
{
break;
}
else
{
deliverycontroller = string.Empty;
}
}
string username = GetLoggedOnUser();
string[] machinearray = restartinfo.MachineNames.ToArray();
Expand Down Expand Up @@ -1593,6 +1620,10 @@ public IHttpActionResult HideSessionsByMachineName([FromBody]CtxSessionsToAction
{
break;
}
else
{
deliverycontroller = string.Empty;
}
}
string username = GetLoggedOnUser();
string[] machinearray = hideinfo.MachineNames.ToArray();
Expand Down

0 comments on commit 2991a59

Please sign in to comment.