TsgcWebSocketServer_HTTPAPIEigenschappen › LogFile

LogFile Eigenschap

Schrijft elk inkomend en uitgaand socketbericht naar een logbestand voor foutopsporing en auditing.

Syntaxis

property LogFile: TsgcWSLogFile read GetLogFile write SetLogFile;

Standaardwaarde

Enabled=False, UnMaskFrames=True

Opmerkingen

Set LogFile.Enabled to True and LogFile.FileName to the full path of the logboek file; every message received and sent over het socket is then appended to het bestand, which is invaluable during development or production troubleshooting. UnMaskFrames (standaard True) stores de payload unmasked for eenvoudiger inspection. Het bestand is opened on demand and closed on elk write; avoid enabling the logboek on production servers under heavy load as disk I/O will become a knelpunt.

Voorbeeld


oServer := TsgcWebSocketServer_HTTPAPI.Create(nil);
oServer.LogFile.FileName := 'c:\logs\server.log';
oServer.LogFile.Enabled := true;
oServer.Active := true;

Terug naar eigenschappen