API GET LogMessages new optional parameter count
This commit is contained in:
parent
28fa85f05c
commit
a4a49d40f0
@ -419,6 +419,19 @@ public class Server : GlobalBase
|
|||||||
SendResponse(HttpStatusCode.NotFound, response);
|
SendResponse(HttpStatusCode.NotFound, response);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestVariables.TryGetValue("count", out string? count))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
uint messageCount = uint.Parse(count);
|
||||||
|
SendResponse(HttpStatusCode.OK, response, logger.Tail(messageCount));
|
||||||
|
}
|
||||||
|
catch (FormatException f)
|
||||||
|
{
|
||||||
|
SendResponse(HttpStatusCode.InternalServerError, response, f);
|
||||||
|
}
|
||||||
|
}else
|
||||||
SendResponse(HttpStatusCode.OK, response, logger.GetLog());
|
SendResponse(HttpStatusCode.OK, response, logger.GetLog());
|
||||||
break;
|
break;
|
||||||
case "LogFile":
|
case "LogFile":
|
||||||
|
Loading…
Reference in New Issue
Block a user