TsgcTCPClient › Properties › LogFile

LogFile Property

Persists inbound and outbound socket traffic to a file, useful for debugging the wire protocol.

Syntax

property LogFile: TsgcWSLogFile read GetLogFile write SetLogFile;

Default Value

Enabled=False, Raw=False

Remarks

Set Enabled=True and FileName to the full path of the output log. Every chunk sent or received on the raw TCP session is appended to the file. Raw stores the bytes in hexadecimal instead of plain text, which is useful when the payload is binary. Access to the log file is not thread-safe, do not share the same file between several threads.

Example


oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.LogFile.FileName := 'C:\Logs\tcp.log';
oTCP.LogFile.Enabled := true;
oTCP.Active := true;

Back to Properties