Indy 9
TIdSysLogMessage
Hierarchy, Properties, Methods, See Also, Unit: IdSysLogMessage
TIdSysLogMessage encapsulates a Syslog (RFC 3164) message.
TIdSysLogMessage = class(TIdBaseComponent)
Unit
IdSysLogMessage
Description
TIdSysLogMessage encapsulates a Syslog (RFC 3164) message for the TIdSysLog and TIdSysLogServer components including the ability to encode and decode the SysLog message.

TIdSysLogMessage.Facility
TIdSysLogMessage, See Also
This property indicates the general area where the SysLog message was generated from.
property Facility: TidSyslogFacility;
Description
This property indicates the general area where the SysLog message was generated from. Setting this property will update the TIdSysLogMessage.Pri property as appropriate.

TIdSysLogMessage.Hostname
TIdSysLogMessage, See Also
IP address or host name for the computer sending the message.
property Hostname: string;
Description
Hostname is a string property that represents the IP address or host name for the computer sending the message. By default, this is set the IP address of the user's computer and is obtained by using GStack.LocalAddress.

Note: This property is not stored in the DFM because the HostName property is specific to a user's computers and storing it in the form files could create a wrong value in the System log.


TIdSysLogMessage.Msg
TIdSysLogMessage, See Also
This property contains the text and process information of the TIdSysLogMessage.
property Msg: TIdSysLogMsgPart;
Description
This property contains the text and process information of the TIdSysLogMessage which can be set or processed as desired. The following values are often used in the TIdSysLogMsgPart object; TIdSysLogMsgPart.PID, TIdSysLogMsgPart.Content, TIdSysLogMsgPart.Process, TIdSysLogMsgPart.PIDAvailable , TIdSysLogMsgPart.Text.

TIdSysLogMessage.Peer
TIdSysLogMessage, See Also
This is the peer that sent the TIdSysLogMessage.
property Peer: String;
Description
Peer is a String property that represents the IP address or hostname for the peer that sent the TIdSysLogMessage to the TIdSysLogServer.

TIdSysLogMessage.Pri
TIdSysLogMessage, See Also
Pri is a calculation of the TIdSysLogMessage.Severity and TIdSysLogMessage.Facility properties and is used in transmitting the TIdSysLogMessage.
property Pri: TIdSyslogPRI;
Description
Pri is a calculation of the TIdSysLogMessage.Severity and TIdSysLogMessage.Facility properties and is used in transmitting the TIdSysLogMessage. Setting this value to a value from 0 to 191 will update the TIdSysLogMessage.Severity and TIdSysLogMessage.Facility properties.

TIdSysLogMessage.RawMessage
TIdSysLogMessage, See Also
Raw contents of the message as read from the socket connection.
property RawMessage: string;
Description
RawMessage is a String property that represents the raw contents of the Syslog message as read from the socket connection. RawMessage contains the values parsed to determine the contents of the Hostname, TimeStamp, Facility, Severity, Pri, and Msg properties.

TIdSysLogMessage.Severity
TIdSysLogMessage, See Also
This property indicates the severity of the SysLog message.
property Severity: TIdSyslogSeverity;
Description
This property indicates the severity of the SysLog message. Setting this property will update the TIdSysLogMessage.Pri property as appropriate.

TIdSysLogMessage.TimeStamp
TIdSysLogMessage, See Also
Date and time that the message was sent.
property TimeStamp: TDateTime;
Description
TimeStamp is a TDateTime property that represents the date and time that a Syslog message was sent. TimeStamp is the value read from the header portion of the Syslog message. If an exception occurs while parsing the message header, TimeStamp will contain the current date and time.

TIdSysLogMessage.assign
TIdSysLogMessage
Copies property values from a persistent source.
procedure assign(Source: TPersistent); override;
Description
Assign is a procedure that allows property values for the current object instance to be copied from the persistent component specified in Source. When Source is an instance of TIdSysLogMessage, the values for the Pri, Msg, HostName and Timestamp properties are updated from the values in Source. Otherwise, the inherited Assign method is called.

TIdSysLogMessage.Create
TIdSysLogMessage, See Also
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using AOwner as the owner of the component instance. Create sets the default value for the PRI property to 13, and uses the global TIdStack instance in GStack to retrieve the value for the HostName property. Create also allocates the TIdSysLogMsgPart used to represent the Msg property.

TIdSysLogMessage.Destroy
TIdSysLogMessage, See Also
Frees the object instance.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy frees resources allocated in Create for the Msg property prior to calling the inherited Destroy method.

TIdSysLogMessage.EncodeMessage
TIdSysLogMessage, See Also
EncodeMessage encodes the SysLog message into a form for sending with a TIdSysLog component.
function EncodeMessage: String; virtual;
Description
EncodeMessage encodes the SysLog message into a form for sending with a TIdSysLog component.

TIdSysLogMessage.ReadFromStream
TIdSysLogMessage, See Also
This message reads a SysLog message from stream.
procedure ReadFromStream(Src: TStream; Size: integer; APeer: String); virtual;
Parameters
Src: TStream
The stream to read the SysLog message from
Size: integer
The size of the data to read
APeer: String
The sender's address
Description
This message reads a SysLog message from stream and sets the TIdSysLogMessage as required. This method is usually called by the TIdSysLogServer before calling the TIdSysLogServer.OnSyslog event handler.

TIdSysLogMessage.SendToHost
TIdSysLogMessage, See Also
Sends the Syslog message to the host specified host.
procedure SendToHost(const Dest: String);
Parameters
const Dest: String
Host name or IP address to receive the syslog message.
Description
SendToHost is public procedure used to send the Syslog message to the host name or IP address indicated in Dest. SendToHost will create a temporary TIdUDPClient instance, when one has nopt already been assigned, to be used to for the transmission to the Syslog daemon in Dest. SendtoHost call TIdUDPClient.Send using Dest and IdPORT_syslog as the destintination for the contents of the message created using EncodeMessage.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.