2
0

API GET LogMessages new optional parameter count

This commit is contained in:
glax 2023-09-13 14:40:23 +02:00
parent 28fa85f05c
commit a4a49d40f0

View File

@ -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":