mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-17 08:45:55 +01:00
c447f76122
7f850ebc Changed filename format strategy. Added JSONL appender. 7bb1d86a Support for Delphi 12 Athens git-subtree-dir: lib/loggerpro git-subtree-split: 7f850ebc12fcca4b2484c8269b3d0f36864a374e
61 lines
1.6 KiB
ObjectPascal
61 lines
1.6 KiB
ObjectPascal
program RESTLogsCollector;
|
|
|
|
{$APPTYPE CONSOLE}
|
|
|
|
uses
|
|
System.SysUtils,
|
|
MVCFramework.Logger,
|
|
MVCFramework.Signal,
|
|
MVCFramework.Commons,
|
|
MVCFramework.REPLCommandsHandlerU,
|
|
Web.ReqMulti,
|
|
Web.WebReq,
|
|
Web.WebBroker,
|
|
IdHTTPWebBrokerBridge,
|
|
LogsCollectorControllerU in 'LogsCollectorControllerU.pas',
|
|
MainWMU in 'MainWMU.pas' {MyWebModule: TWebModule},
|
|
LoggerProConfig in 'LoggerProConfig.pas',
|
|
LoggerPro.FileAppender in '..\..\LoggerPro.FileAppender.pas',
|
|
LoggerPro in '..\..\LoggerPro.pas';
|
|
|
|
{$R *.res}
|
|
|
|
procedure RunServer(APort: Integer);
|
|
var
|
|
lServer: TIdHTTPWebBrokerBridge;
|
|
begin
|
|
Writeln('** LoggerPro RESTLogsCollector [DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION + ']');
|
|
lServer := TIdHTTPWebBrokerBridge.Create(nil);
|
|
try
|
|
lServer.DefaultPort := APort;
|
|
|
|
{ more info about MaxConnections
|
|
http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_MaxConnections.html }
|
|
lServer.MaxConnections := 0;
|
|
|
|
{ more info about ListenQueue
|
|
http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_ListenQueue.html }
|
|
lServer.ListenQueue := 200;
|
|
lServer.Active := True;
|
|
Write('CTRL + C to EXIT');
|
|
WaitForTerminationSignal;
|
|
finally
|
|
lServer.Free;
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
ReportMemoryLeaksOnShutdown := True;
|
|
IsMultiThread := True;
|
|
try
|
|
if WebRequestHandler <> nil then
|
|
WebRequestHandler.WebModuleClass := WebModuleClass;
|
|
WebRequestHandlerProc.MaxConnections := 1024;
|
|
RunServer(8080);
|
|
except
|
|
on E: Exception do
|
|
Writeln(E.ClassName, ': ', E.Message);
|
|
end;
|
|
|
|
end.
|