Class: StatusDbLog
Properties | Events | Methods | Index of Classes
Used for logging status and error reports from unattended (batch) processes to a database file
Hierarchy
cObject > StatusDbLog
Show full hierarchy and direct subclasses
- cObject
- StatusDbLog
Library: Common Class Library
Package: StatFLog.pkg
Description
StatusdbLog is used for logging status and error reports from unattended (batch) processes to a database file. Objects based on this class must have access to a table named StatLog.
Use StatFLog.Pkg // StatusdbLog class
:
Object Status_Log is a StatusdbLog // this needs table StatLog
End_Object
Batch Process objects such as BusinessProcess and BasicReport contain an interface that uses this object. The batch process is connected to the status log object by setting the Status_log_id property in the batch object
object oObjectName is a {businessProcess| basicReport}
Set Status_log_id to Status_Log
Using the StatLog.pkg
Objects of this class can be instantiated by use-ing the STATLOG.PKG file in a program. The resultant global status-log object is named status_log and can be placed in use simply by setting the status_log_id property of the object requiring its services (a business process or report) to the value of that object by name.
Use StatLog.pkg
:
object oObjectName is a {BusinessProcess | BasicReport}
Set Status_log_id to Status_Log
Use of this class for subclassing to create custom status-log capabilities is encouraged. The provided class is quite rudimentary, and is intended to be used as a framework on which you can build your desired functionalities as extensions. Direct instantiation of this class or any subclass of it is not encouraged. The STATLOG.PKG file should be used.
This class is provided as an example of a simple example of status logging. You are encouraged to create you own sub-classes or replacements for this class. Batch process objects that use objects based on this class must use the standard interface created to use this class. The two public messages that must be supported are Log_Status and Log_Clear.
Status Logging in Processes
Status logging refers to a defined interface for sending information to a status-logging object. Various properties and methods are created within a BusinessProcess class (BPOs) to support easy status logging. The program must set the property Status_log_Id to the object ID of the status-log object. It can then set the property Status_log_State to true. When true, a log entry is sent when a BPO process is started, a BPO process is ended, and when an error occurs. Additional status lines can be sent by sending the message log_status passing the text to be logged.
The actual interface to the status-log object consists of two public messages: Log_Status and Log_Clear. It is the status-log object's responsibility to do something useful with these messages. The prototype log object provided with DataFlex (found in StatLog.pkg, StatALog.pkg and StatFLog.pkg) writes a log entry consisting of date, time, and comment to a simple table. It is expected that you may wish to expand upon this logging process by extending the table (e.g., adding a user name), its indexes, by moving the log file to another filelist entry, or by expanding the interface (e.g., add ability to review the log, sort by user name). The log object was purposely kept simple. The database status logging class StatusdbLog, does however provide basic multi-user logging.
The StatLog Table Definition
Objects of this class output to a database table named STATLOG. Its definition is listed below. Note that this may be added as any entry within your filelist and that this is a minimum specification for this table. You may wish to add additional fields and indexes. You must create this table and its filelist entry before this object can perform its intended function.
-----------------------------------------------------------------------------
DATE: 12/10/2004 TIME: 12:45 PAGE: 1
FILE DEFINITION FOR FILE: STATLOG (# 52)
-----------------------------------------------------------------------------
DRIVER NAME : DATAFLEX
FILE ROOT NAME : StatLog
USER DISPLAY NAME : Status Log
DATAFLEX FILE NAME : STATLOG
-----------------------------------------------------------------------------
RECORD LENGTH : 73 ( USED: 68 )
MAX NUMBER OF RECORDS : 10000 ( USED: 0 )
FILE COMPRESSION : NONE
RE-USE DELETED SPACE : YES
LOCKING TYPE : FILE
HEADER INTEGRITY CHECKING : YES
TRANSACTION TYPE : CLIENT ATOMIC
RECORD IDENTITY INDEX : 0 ( 0 , 0 )
FILE LOGIN PARAMETER :
SYSTEM FILE : NO
-----------------------------------------------------------------------------
NUM FIELD NAME TYPE SIZE OFFST IX RELATES TO FILE.FIELD
--- --------------- ---- ----- ----- -- ---------------------------------
1 DATE DAT 6 1
2 TIME ASC 5 4
3 DESCRIPTION ASC 60 9
See Also