PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • The different types of logs
  • Logs available in HFSQL Classic mode
  • Logs available in HFSQL Client/Server mode
  • Implementing the log process
  • Defining the log process for the data files
  • Defining the log process for the items
  • Generating the analysis
  • Automatic data modification and log process
  • The different files created when implementing the log process
  • Files created in HFSQL Classic mode
  • Files created in HFSQL Client/Server mode
  • WDLog: tool for log management
  • Handling the logs by programming
  • Two data files must not use the same log file
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Implementing the log process in an application
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Overview
Regardless of the data files used by your application (HFSQL Classic or HFSQL Client/Server), the log process can be implemented on these data files.
To implement the log process on the files of your application, you must:
  1. Define the type of log process to perform.
  2. Define the log process for the data files.
  3. Define the log process for the items.
The files created by the log process depend on the type of access to your data files (HFSQL Classic or HFSQL Client/Server).
The logged files can be handled by WDLog or by programming.
Note: The log process is not available when accessing a database via Remote access.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
The different types of logs
WINDEVWEBDEV - Server codeWindowsHFSQL

Logs available in HFSQL Classic mode

WINDEV, WEBDEV and WINDEV Mobile propose the following options to log your data files: several files are automatically created according to the selected option.
OptionAction performedFiles automatically created
No log (default option)None
Write-to-file logThe following information will be saved:
  1. All the additions, modifications and deletions performed on the current file.
  2. The value of the records handled BEFORE and AFTER the operation.
When should I choose this option?
To find out who modified the file as well as the modification that was performed.
<File Name>JNL.fic
History of accessesAll the operations performed on the logged files of the application are saved. The value of the records used is not be saved.

When should I choose this option?
To find out the operations performed on the logged files of the application.
JournalOperation.fic
JournalIdentification.Fic
Write-to-file log + History of accessesThe following information will be saved:
  1. All the additions, modifications and deletions performed on the current file.
  2. The value of the records handled BEFORE and AFTER the operation.
  3. All the operations performed on the logged files of the application are saved.
When should I choose this option?
To find out:
  • who modified the file,
  • what modification was performed.
  • what are the operations performed on the file.
<File name>.JNL.fic
JournalOperation.fic
JournalIdentification. fic
WINDEVWEBDEV - Server codeWindowsWindows MobileHFSQL Client/Server

Logs available in HFSQL Client/Server mode

In Client/Server mode, WINDEV, WEBDEV and WINDEV Mobile propose the following options to log your data files: several files are automatically created according to the selected option.
OptionAction performedFiles automatically created
No log (default option)None
Write-to-file logThe following information will be saved:
  1. All the additions, modifications and deletions performed on the current file.
  2. The value of the records handled BEFORE and AFTER the operation.
<File Name>JNL.fic
JNL_FILES.fic
JNL_OPERATION.fic
JNL_USER.fic
Implementing the log process

Defining the log process for the data files

The implementation of the log process on the HFSQL Classic or Client/Server data files is performed in the data model editor.
To implement the log process on a file described in the analysis:
  1. Perform a backup of the data files in their current status with WDLog.
  2. In the data model editor, display the description of the requested file ("Structure of files .. Description").In the data model editor, display the description of the requested file:
    • Select the file in the editor.
    • Select "Description of data file" from the popup menu.
  3. In the "Various" tab, select the type of log to manage for this file.
  4. Depending on the selected option, specify (if necessary) the directory of the different files created by the log process.
  • HFSQL Caution: the JournalIdentification and JournalOperation files are always found in the same directory. By default, these files are created in the directory of the application.
    • This directory is defined in the analysis options ("Analysis .. Description", "Log/Replication" tab).
    • This directory is defined in the analysis options: click in the background of the analysis graph and select "Analysis description" from the popup menu.
    • This directory can be modified for each file.
  • HFSQL Tip: the log files are used to save the operations performed on a file and to replay them on a backup if a problem occurs (unusable disk for example). We recommend that you save the log files in directories (and even disks) different from the ones used for the data files.

Defining the log process for the items

By default, all the items of a logged file are automatically logged. You have the ability to define:
  • whether some items must be logged or not. For example, if one of the data files uses a memo item to store an image (information not that important and that does not change very often), you have the ability not log this item.
  • whether the logged item must be a key in the log. This option allows you to easily retrieve a record in the log.
To avoid implementing a log on an item:
  1. Display the description of the file.
  2. Display the description of the requested item.
  3. In the "Advanced" tab, uncheck "Log the item".

Generating the analysis

Once the log process was defined in the data model editor, the analysis can be generated.
Caution: Before performing this operation, we recommend that you save the data files with WDLog.

Automatic data modification and log process

When the automatic modification of data files is performed on the logged files:
  1. The log files are automatically saved.
  2. The log files are flushed.
The different files created when implementing the log process
WINDEVWEBDEV - Server codeWindowsHFSQL

Files created in HFSQL Classic mode

When a log option has been requested for an analysis file, the following files can be created:
JournalOpération.FicList of all the operations performed on the logged HFSQL data files used by the application. An operation corresponds to a HFSQL function.
JournalIdentification.FicList of the physical locations of all the logged files found in the application
* JNL.FicFile created for each logged file. Contains the value of records used before and after each operation.
For more details, see: structure of log files.
To configure the location of these files and their password:
  • JournalOperation and JournalIdentification files: By default, these files are created in the directory of the application. To modify this directory:
    1. Display the analysis description: click in the analysis graph, display the popup menu and select "Analysis description".
    2. Display the "Log" tab.
    3. Select the directory of the file and its password if necessary.
    Note: This directory can also be modified for each logged file ("Description of the data file" from the popup menu, "Various" tab). In this case, the JournalOperation and JournalIdentification files will be created for each file at the specified location.
  • *JNL file: By default, this file is created in the directory of the application. To modify this directory:
    1. Display the description of the file: "Description of data file" from the popup menu.
    2. Display the "Various" tab.
    3. Select the directory of the file.
    Note: The password of the *JNL file will be identical to the password of the data file.
WINDEVWEBDEV - Server codeWindowsWindows MobileHFSQL Client/Server

Files created in HFSQL Client/Server mode

When a log option has been requested for an analysis file, the following files can be created:
JNL_FILES.FicDescription of logged files
JNL_OPERATION.FicDescription of actions performed on a logged file
JNL_USERS.FicDescription of users who perform an action on a logged file.
*JNL.FicFile created for each logged file. Contains the value of records used before and after each operation.
For more details, see: structure of the log files in Client/Server mode.
WDLog: tool for log management
WDLog is used to:
  • Save and restore your data files
  • Check the consistency of a log and clear it if necessary
  • Restore a data file from its log.
  • Find out who modified a record, and when, ...
This tool can be freely distributed along with your applications. See WDLog for more details.
Handling the logs by programming
The management of logs is automatically performed. However, several WLanguage functions can be used to handle the logs:
HChangeLogDirDynamically modifies the location of the log files corresponding to a HFSQL file (*JNL files and JournalOperation and JournalIdentification files).
HFSQL Client/Server This function has no effect.
HSetLogUsed to enable (or not) the log management. This management is enabled by default. If logs do not have to be managed in a process, call HSetLog(False). In this case, the execution of the processes will be faster.
HHistoryModificationReturns the modifications made to one or more items of a given record.
HLogInfoAdds comments to the log when saving the logged operation. These comments can be viewed in WDLog.
HLogRecreateRe-creates an empty log. This function is used to reset a log to 0 after a backup or a replication for example. The content of the existing files is lost.
HLogRestartRestarts the log process on a file. This log process was stopped by HLogStop.
HLogStopStops the log process of a file. The operations performed in the logged file are not saved anymore.
HRegenerateFileRegenerates a file from its log.
The WLanguage properties can also be used to manage the logged files:
LogFileAllows you to find out whether a data file is a log file or not.
Log processIdentifies the log mode used for a data file (defined in the data model editor or dynamically).
LogDirectoryAllows you to manage the directory of the log file described in the analysis. You can:
  • Find out the directory of the log for a file defined in the data model editor or dynamically.
  • Define the directory of the log for a file that was defined dynamically.
HFSQL Client/Server This property returns "." (current directory).
OperationLogDirectoryAllows you to manage the directory for the operation file of the log associated with a logged file. You can:
  • Find out the directory of the operation log linked to a logged file defined in the data model editor or dynamically.
  • Define the log file directory for a file defined dynamically.
HFSQL Client/Server This property has no effect.
WINDEVWEBDEV - Server codeWindowsHFSQL

Two data files must not use the same log file

Several cases may occur:
  • When creating a data file, the log uses the GUIDs to check whether two data files found at different locations do not use the same log file. Indeed, the data found in the log could be corrupted if the same log file is used by several data files.
    An error is displayed if the same log file is used by several files.
  • When copying or moving a data file, the GUID of this file is not modified. In this case, the HFSQL engine detects that the location of the data file was modified. A new record is automatically added into the JournalIdentification file in order to specify the new location of the data file and its GUID. However, no check is performed by the log.
    The developer should make sure that two copies of the same data file found at different locations do not use the same log file, in which case the content of the log file would not correspond to any of the two files.
  • When a data file is replaced by one of its earlier backups, the GUID is not modified. This operation is not automatically detected by the log process.
    In such situation, you must delete the JNL file at the same time as its data file and eventually restore the JNL file saved at the time as the data file.
Reminder: Two types of file GUID are supported by the HFSQL engine:
  • File GUID defined when the file was described in the data model editor. This GUID is used to manage the .REP.
  • File GUID defined when creating the physical data file. This GUID is used in the log process.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment