Goto: 4C Home | 4C Docs | 4C Logging Home 4C Logging - Intro

4C Logging - Intro

4C version 4.0.3 and higher allows you to log changes to your data files. The reason for introducing the logging capability was to make it possible to replicated 4C files to external database files. There are at least several other ways that this type of log can be used including the following:


4C Logging - Files

The following files are involved in 4C logging and must exist only in the XLSYSTEM directory and not in any application directory

In addition to the above 4C also uses the following files:

Each log is maintained in it's own directory. The log directory will contain the log_idx and all the log_data files. The directory and files must be created before a particular log can be used. The newlog.sh script can be used for this purpose. It is located in XLLIB. Currently it creates the log_idx and log_data files with read/write acces for everybody. You can change those permissions but any process that updates a file that is being logged must have permission to update the log as well.


4C Logging - Programs

The lh.fm program is the main log definition program. You can access this program from the sys.menu.tv program under Environment/Log Maintenance. The display fields shown are:

Once you've added a log_hdr record, you can add details. From the LogDefinition screen, go to the detail screen by selecting details. The display fields for the details screen are:

There are also several cmdbtns at the bottom that allow you to enable or disable groups of files or to verify that the Ext Name exists. Currently VerifyExtnames only works with JISAM files.

There is a simple log viewer program that you can run from the Log Maintenance program. You have a choice of viewing either QuickDetails or PKeyDetails. The QuickDetails option does not need to open the log_data file. It only needs to read the correct log_idx file. Hence, it runs faster. The PKeyDetails shows the same info, plus the primary key of the record changed. From either of these detail screens you can view full BeforeImage and AfterImage detail.

The le.fm program is used to view any logging errors You can access this program from the sys.menu.tv program under Environment/Log Errors. You should run this program regularly until you are sure your logging is working properly.




4C Logging - System PCLs

4C provides several PCLs for reading a log. They are:

When the above PCLs return an error, sys.errno will be set to one of the following:

Using the above PCLs it is fairly easy to implement a Data Replication Application between different 4C Servers.


4C Logging - Misc



Back to Top