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 (TROSession): TDASessionLog overload
Finds a session log item.
function FindSessionLog(aSession: TROSession): TDASessionLog
Parameters:
- aSession:
FindSessionLog (TGUID): TDASessionLog overload
Finds a session log item.
function FindSessionLog(aSessionID: TGUID): TDASessionLog
Parameters:
- aSessionID:
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 (TROSession, Boolean) overload
Removes a session log item.
procedure RemoveSessionLog(aSession: TROSession; aRemoveRelatedLogs: Boolean)
Parameters:
- aSession:
- aRemoveRelatedLogs:
RemoveSessionLog (TGUID, Boolean) overload
Removes a session log item.
procedure RemoveSessionLog(aSessionID: TGUID; aRemoveRelatedLogs: Boolean)
Parameters:
- aSessionID:
- aRemoveRelatedLogs:
SaveToXML (string) overload
Saves all logs to file
procedure SaveToXML(aFileName: string)
Parameters:
- aFileName:
SaveToXML (IXMLDocument) overload virtual
Saves all logs in a XML file or IXMLDocument.
procedure SaveToXML(const aXMLDocument: IXMLDocument)
Parameters:
- aXMLDocument:
SessionLogs
Returns a session logs element as TDASessionLog structure.
property SessionLogs[Index: Integer]: TDASessionLog read
SessionLogsCount
Returns a session logs count which was added via AddSessionLog method.
property SessionLogsCount: Integer read
SQLCommandLogs
Returns a command logs element as TDASQLCommandLog structure.
property SQLCommandLogs[Index: Integer]: TDASQLCommandLog read
SQLCommandLogsCount
Returns a command logs count which was added via AddSQLCommandLog method.
property SQLCommandLogsCount: Integer read
SQLErrorLogs
Returns an error logs element as TDASQLErrorLog structure.
property SQLErrorLogs[Index: Integer]: TDASQLErrorLog read
SQLErrorLogsCount
Returns an error logs count which was added via AddSQLErrorLog method.
property SQLErrorLogsCount: Integer read
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
SessionLogsCount
Returns a session logs count which was added via AddSessionLog method.
property SessionLogsCount: Integer read
SQLCommandLogs
Returns a command logs element as TDASQLCommandLog structure.
property SQLCommandLogs[Index: Integer]: TDASQLCommandLog read
SQLCommandLogsCount
Returns a command logs count which was added via AddSQLCommandLog method.
property SQLCommandLogsCount: Integer read
SQLErrorLogs
Returns an error logs element as TDASQLErrorLog structure.
property SQLErrorLogs[Index: Integer]: TDASQLErrorLog read
SQLErrorLogsCount
Returns an error logs count which was added via AddSQLErrorLog method.
property SQLErrorLogsCount: Integer read
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 (TROSession): TDASessionLog overload
Finds a session log item.
function FindSessionLog(aSession: TROSession): TDASessionLog
Parameters:
- aSession:
FindSessionLog (TGUID): TDASessionLog overload
Finds a session log item.
function FindSessionLog(aSessionID: TGUID): TDASessionLog
Parameters:
- aSessionID:
RegisterLogServer protected
procedure RegisterLogServer
RemoveSessionLog (TROSession, Boolean) overload
Removes a session log item.
procedure RemoveSessionLog(aSession: TROSession; aRemoveRelatedLogs: Boolean)
Parameters:
- aSession:
- aRemoveRelatedLogs:
RemoveSessionLog (TGUID, Boolean) overload
Removes a session log item.
procedure RemoveSessionLog(aSessionID: TGUID; aRemoveRelatedLogs: Boolean)
Parameters:
- aSessionID:
- aRemoveRelatedLogs:
SaveToXML (string) overload
Saves all logs to file
procedure SaveToXML(aFileName: string)
Parameters:
- aFileName:
SaveToXML (IXMLDocument) overload virtual
Saves all logs in a XML file or IXMLDocument.
procedure SaveToXML(const aXMLDocument: IXMLDocument)
Parameters:
- aXMLDocument:
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)