AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Gestión de registros
  • 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: log management utility
  • Handling the logs programmatically
  • Two data files must not use the same log file
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Implementing the log process in an application
HFSQL ClassicHFSQL Client/ServerDisponible solo con estos tipos de conexión
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).
Files with logs can be manipulated programmatically or using WDLog.
The different types of logs
WINDEVWEBDEV - Código ServidorWindowsHFSQL Classic

Logs available in HFSQL Classic mode

WINDEV, WEBDEV and WINDEV Mobile offer the following options for logging your data files: depending on the option selected, different files are automatically created.
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
Access historyAll operations performed on the logged files of 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 + access historyThe 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 operations performed on the logged files of 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 - Código ServidorWindowsHFSQL Client/Server

Logs available in HFSQL Client/Server mode

In Client/Server mode, WINDEV, WEBDEV and WINDEV Mobile offer the following options for logging your data files: depending on the option selected, different files are automatically created.
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 log process on HFSQL Classic or Client/Server data files is implemented in the data model editor.
To implement the log process on a data file described in the analysis:
  1. Make a backup copy of the data files in their current status with WDLog.
  2. In the data model editor, open the description of the desired data file:
    • Select the data file in the editor.
    • Select "Description of data file" in the context menu.
  3. On the "Miscellaneous" tab, select the type of log to manage for this data file.
  4. Depending on the selected option, specify (if necessary) the directory of the different files created by the log process.
HFSQL Classic Remarks:
  • Note: the JournalIdentification and JournalOperation files are always located in the samedirectory. . By default, these files are created in the directory of the application.
    This directory is defined in the analysis options: click at the bottom of the analysis graph and select "Analysis description" from the context menu..
    This directory can be modified for each data file.
  • Conseil: log files are used to record operations performed on a file, so that they can be replayed on a backup in the event of a problem (e.g. unusable disk).. 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 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 file description.
  2. Display the description of requested item.
  3. On the "Advanced" tab, uncheck "Crear registro del campo".

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 you back up your data files with WDLog.

Automatic data modification and log process

When the automatic data file modification is performed on logged data files:
  1. The log files are automatically saved.
  2. The log files are flushed.
The different files created when implementing the log process
WINDEVWEBDEV - Código ServidorWindowsHFSQL Classic

Files created in HFSQL Classic mode

When a log option has been requested for an analysis file, the following files can be created:
JournalOperation.FicList of all the operations performed on the logged HFSQL data files used by the application. An operation corresponds to an HFSQL function.
JournalIdentification.FicList of physical locations of all 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 on the structure of these files, see: structure of log files.
To configure the location of these files and their password:
  • LogOperation and LogIdentification files: By default, these files are created in the application directory. To modify this directory:
    1. Display the analysis description: click on the analysis graph, display the context menu and select "Analysis description"..
    2. Go to the "Log" tab.
    3. Select the file directory and its password if necessary.
    Note: This directory can also be modified for each log file (option "Data file description" in the context menu, "Miscellaneous" 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 application directory.. To modify this directory:
    1. Display the file description: "Data file description" option in the context menu.
    2. Go to the "Miscellaneous" tab.
    3. Select the file directory.
    Note: The password for the *JNL.fic file will be identical to the password for the data file.
WINDEVWEBDEV - Código ServidorWindowsHFSQL 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 on the structure of these files, see: structure of the log files in Client/Server mode.
WDLog: log management utility
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. For more details, see WDLog.
Handling the logs programmatically
The management of logs is automatically performed. However, several WLanguage functions can be used to handle the logs:
HChangeLogDirDynamically change the location of log files corresponding to an HFSQL file (*JNL file and LogOperation and LogIdentification files).
HFSQL Client/Server This function has no effect.
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.
HLogRecreateRecreates 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.
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.

The WLanguage properties can also be used to manage the logged files:
LogDirectoryManages the log file directory described in the analysis. You can:
  • Find out the directory of log for a file defined in the data model editor or dynamically.
  • Define the log directory for a file that was defined dynamically.
HFSQL Client/Server This property returns "." (current directory).
LogFileAllows you to find out whether a data file is a log file or not.
LogMethodIdentifies the log mode used for a data file (defined in the data model editor or dynamically).
OperationLogDirectoryAllows you to manage the directory of the log of operations file associated with a Journalé file.. You can:
  • Find out the directory of 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 - Código ServidorWindowsHFSQL Classic

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 with 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 GUIDs are managed 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.
Ver también
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 21/09/2024

Señalar un error o enviar una sugerencia | Ayuda local