TDAServerLog

Overview

This component is used for logging your sessions, SQL commands and errors. It stores this information in a XML file or IXMLDocument.

TDAServerLog uses methods for logging AddSessionLog, AddSQLCommandLog, AddSQLErrorLog and overloaded methods for storing SaveToXML.

uDAServerLog module has the "ServerLog" global variable in order to get access to the DAServerLog object.

Location

  • Unit: uDAServerLog.pas
  • Ancestry: TComponent | TDAServerLog

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: owner

Active

Toggles whether the server log is currently active. If it's false, the methods AddSessionLog, AddSQLCommandLog and AddSQLErrorLog are ignored.

property Active: boolean read write

AddSessionLog

Adds a session log info.

function AddSessionLog(aSession: TROSession; aLoginInfo: TROComplexType): TDASessionLog

Parameters:

  • aSession:
  • aLoginInfo:

AddSQLCommandLog

Adds a SQL command log item.

function AddSQLCommandLog(aSession: TROSession; const aCommand: IDASQLCommand; anActualSQLText: string; aElapsedMilliseconds: Cardinal): TDASQLCommandLog

Parameters:

  • aSession:
  • aCommand:
  • anActualSQLText:
  • aElapsedMilliseconds:

AddSQLErrorLog

Adds a SQL error log item.

function AddSQLErrorLog(aSession: TROSession; aError: Exception; const aCommand: IDASQLCommand; aActualSQLText: string): TDASQLErrorLog

Parameters:

  • aSession:
  • aError:
  • aCommand:
  • aActualSQLText:

Assign  override

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

ClearSessionLogs

Clears all session log items.

procedure ClearSessionLogs(aRemoveRelatedLogs: boolean)

Parameters:

  • aRemoveRelatedLogs:

ClearSQLCommandLogs  overload

Clears all SQL command log items.

procedure ClearSQLCommandLogs

ClearSQLCommandLogs (TGUID)  overload

Clears all SQL command log items for specific session.

procedure ClearSQLCommandLogs(aSessionID: TGUID)

Parameters:

  • aSessionID:

ClearSQLErrorLogs  overload

Clears all SQL error log items.

procedure ClearSQLErrorLogs

ClearSQLErrorLogs (TGUID)  overload

Clears all SQL error log items for specific session.

procedure ClearSQLErrorLogs(aSessionID: TGUID)

Parameters:

  • aSessionID:

FindSessionLog (TGUID): TDASessionLog  overload

Finds a session log item.

function FindSessionLog(aSessionID: TGUID): TDASessionLog

Parameters:

  • aSessionID:

FindSessionLog (TROSession): TDASessionLog  overload

Finds a session log item.

function FindSessionLog(aSession: TROSession): TDASessionLog

Parameters:

  • aSession:

OnAddSessionLog

Fires whenever you execute the AddSessionLog method.

property OnAddSessionLog: TDASessionLogEvent read write
delegate: procedure OnAddSessionLog(Sender: TDAServerLog; SessionLog: TDASessionLog)

OnAddSQLCommandLog

Fires whenever you execute the AddSQLCommandLog method.

property OnAddSQLCommandLog: TDASQLCommandLogEvent read write
delegate: procedure OnAddSQLCommandLog(Sender: TDAServerLog; SQLCommandLog: TDASQLCommandLog)

OnAddSQLErrorLog

Fires whenever you execute the AddSQLErrorLog method.

property OnAddSQLErrorLog: TDASQLErrorLogEvent read write
delegate: procedure OnAddSQLErrorLog(Sender: TDAServerLog; SQLErrorLog: TDASQLErrorLog)

OnLogClassesDefinition

Fires after a server log was loaded.

property OnLogClassesDefinition: TDALogClassesDefinitionEvent read write
delegate: procedure OnLogClassesDefinition(Sender: TDAServerLog; var aSessionLogClass: TDASessionLogClass; var aSQLCommandLogClass: TDASQLCommandLogClass; var aSQLErrorLogClass: TDASQLErrorLogClass)

OnRemoveSessionLog

Fires whenever you execute the RemoveSessionLog method.

property OnRemoveSessionLog: TDASessionLogRemoveEvent read write
delegate: procedure OnRemoveSessionLog(Sender: TDAServerLog; SessionLog: TDASessionLog; var RemoveRelatedLogs: boolean)

RegisterLogServer  protected

procedure RegisterLogServer

RemoveSessionLog (TGUID, boolean)  overload

Removes a session log item.

procedure RemoveSessionLog(aSessionID: TGUID; aRemoveRelatedLogs: boolean)

Parameters:

  • aSessionID:
  • aRemoveRelatedLogs:

RemoveSessionLog (TROSession, boolean)  overload

Removes a session log item.

procedure RemoveSessionLog(aSession: TROSession; aRemoveRelatedLogs: boolean)

Parameters:

  • aSession:
  • aRemoveRelatedLogs:

SaveToXML (IXMLDocument)  overload virtual

Saves all logs in a XML file or IXMLDocument.

procedure SaveToXML(const aXMLDocument: IXMLDocument)

Parameters:

  • aXMLDocument:

SaveToXML (string)  overload

Saves all logs to file

procedure SaveToXML(aFileName: string)

Parameters:

  • aFileName:

SessionLogs

Returns a session logs element as TDASessionLog structure.

property SessionLogs[Index: integer]: TDASessionLog read write

SessionLogsCount

Returns a session logs count which was added via AddSessionLog method.

property SessionLogsCount: integer read write

SQLCommandLogs

Returns a command logs element as TDASQLCommandLog structure.

property SQLCommandLogs[Index: integer]: TDASQLCommandLog read write

SQLCommandLogsCount

Returns a command logs count which was added via AddSQLCommandLog method.

property SQLCommandLogsCount: integer read write

SQLErrorLogs

Returns an error logs element as TDASQLErrorLog structure.

property SQLErrorLogs[Index: integer]: TDASQLErrorLog read write

SQLErrorLogsCount

Returns an error logs count which was added via AddSQLErrorLog method.

property SQLErrorLogsCount: integer read write

UnRegisterLogServer  protected

procedure UnRegisterLogServer

 

Active

Toggles whether the server log is currently active. If it's false, the methods AddSessionLog, AddSQLCommandLog and AddSQLErrorLog are ignored.

property Active: boolean read write

SessionLogs

Returns a session logs element as TDASessionLog structure.

property SessionLogs[Index: integer]: TDASessionLog read write

SessionLogsCount

Returns a session logs count which was added via AddSessionLog method.

property SessionLogsCount: integer read write

SQLCommandLogs

Returns a command logs element as TDASQLCommandLog structure.

property SQLCommandLogs[Index: integer]: TDASQLCommandLog read write

SQLCommandLogsCount

Returns a command logs count which was added via AddSQLCommandLog method.

property SQLCommandLogsCount: integer read write

SQLErrorLogs

Returns an error logs element as TDASQLErrorLog structure.

property SQLErrorLogs[Index: integer]: TDASQLErrorLog read write

SQLErrorLogsCount

Returns an error logs count which was added via AddSQLErrorLog method.

property SQLErrorLogsCount: integer read write

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: owner

AddSessionLog

Adds a session log info.

function AddSessionLog(aSession: TROSession; aLoginInfo: TROComplexType): TDASessionLog

Parameters:

  • aSession:
  • aLoginInfo:

AddSQLCommandLog

Adds a SQL command log item.

function AddSQLCommandLog(aSession: TROSession; const aCommand: IDASQLCommand; anActualSQLText: string; aElapsedMilliseconds: Cardinal): TDASQLCommandLog

Parameters:

  • aSession:
  • aCommand:
  • anActualSQLText:
  • aElapsedMilliseconds:

AddSQLErrorLog

Adds a SQL error log item.

function AddSQLErrorLog(aSession: TROSession; aError: Exception; const aCommand: IDASQLCommand; aActualSQLText: string): TDASQLErrorLog

Parameters:

  • aSession:
  • aError:
  • aCommand:
  • aActualSQLText:

Assign  override

Copies data from a given source.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

ClearSessionLogs

Clears all session log items.

procedure ClearSessionLogs(aRemoveRelatedLogs: boolean)

Parameters:

  • aRemoveRelatedLogs:

ClearSQLCommandLogs  overload

Clears all SQL command log items.

procedure ClearSQLCommandLogs

ClearSQLCommandLogs (TGUID)  overload

Clears all SQL command log items for specific session.

procedure ClearSQLCommandLogs(aSessionID: TGUID)

Parameters:

  • aSessionID:

ClearSQLErrorLogs  overload

Clears all SQL error log items.

procedure ClearSQLErrorLogs

ClearSQLErrorLogs (TGUID)  overload

Clears all SQL error log items for specific session.

procedure ClearSQLErrorLogs(aSessionID: TGUID)

Parameters:

  • aSessionID:

FindSessionLog (TGUID): TDASessionLog  overload

Finds a session log item.

function FindSessionLog(aSessionID: TGUID): TDASessionLog

Parameters:

  • aSessionID:

FindSessionLog (TROSession): TDASessionLog  overload

Finds a session log item.

function FindSessionLog(aSession: TROSession): TDASessionLog

Parameters:

  • aSession:

RegisterLogServer  protected

procedure RegisterLogServer

RemoveSessionLog (TGUID, boolean)  overload

Removes a session log item.

procedure RemoveSessionLog(aSessionID: TGUID; aRemoveRelatedLogs: boolean)

Parameters:

  • aSessionID:
  • aRemoveRelatedLogs:

RemoveSessionLog (TROSession, boolean)  overload

Removes a session log item.

procedure RemoveSessionLog(aSession: TROSession; aRemoveRelatedLogs: boolean)

Parameters:

  • aSession:
  • aRemoveRelatedLogs:

SaveToXML (IXMLDocument)  overload virtual

Saves all logs in a XML file or IXMLDocument.

procedure SaveToXML(const aXMLDocument: IXMLDocument)

Parameters:

  • aXMLDocument:

SaveToXML (string)  overload

Saves all logs to file

procedure SaveToXML(aFileName: string)

Parameters:

  • aFileName:

UnRegisterLogServer  protected

procedure UnRegisterLogServer

 

OnAddSessionLog

Fires whenever you execute the AddSessionLog method.

property OnAddSessionLog: TDASessionLogEvent read write
delegate: procedure OnAddSessionLog(Sender: TDAServerLog; SessionLog: TDASessionLog)

OnAddSQLCommandLog

Fires whenever you execute the AddSQLCommandLog method.

property OnAddSQLCommandLog: TDASQLCommandLogEvent read write
delegate: procedure OnAddSQLCommandLog(Sender: TDAServerLog; SQLCommandLog: TDASQLCommandLog)

OnAddSQLErrorLog

Fires whenever you execute the AddSQLErrorLog method.

property OnAddSQLErrorLog: TDASQLErrorLogEvent read write
delegate: procedure OnAddSQLErrorLog(Sender: TDAServerLog; SQLErrorLog: TDASQLErrorLog)

OnLogClassesDefinition

Fires after a server log was loaded.

property OnLogClassesDefinition: TDALogClassesDefinitionEvent read write
delegate: procedure OnLogClassesDefinition(Sender: TDAServerLog; var aSessionLogClass: TDASessionLogClass; var aSQLCommandLogClass: TDASQLCommandLogClass; var aSQLErrorLogClass: TDASQLErrorLogClass)

OnRemoveSessionLog

Fires whenever you execute the RemoveSessionLog method.

property OnRemoveSessionLog: TDASessionLogRemoveEvent read write
delegate: procedure OnRemoveSessionLog(Sender: TDAServerLog; SessionLog: TDASessionLog; var RemoveRelatedLogs: boolean)