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 logging for your application's data filesyou need to:
  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 log data files can then be manipulated using the WDLog tool or by programming.
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 add, modify and delete operations performed on the current data file.
  2. The value of the records handled BEFORE and AFTER the operation.
When should I choose this option?
To find out at any time who has modified the data file and what changes have been made.
<Nom du fichier de données>JNL.fic
Access historyAll operations performed on all the application's log data files are recorded. The value of the records used is not be saved.

When should I choose this option?
To find out at any time what operations have been carried out on the application's various log data files.
JournalOperation.fic
JournalIdentification.Fic
Write-to-file log + access historyThe following information will be saved:
  1. All add, modify and delete operations performed on the current data 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:
  • which has modified the data file,
  • what modification was performed.
  • which operations are performed on the data 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 add, modify and delete operations performed on the current data file.
  2. The value of the records handled BEFORE and AFTER the operation.
<Nom du fichier de données>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.
  • Tip Log files are used to record operations performed on a data 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 fields in a log 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 an analysis data file has been described with a logging option, 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 application log data files
* JNL.FicFile created for each log data 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 data file logged (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 log data file.
JNL_USERS.FicDescription of users performing an action on a log data file.
*JNL.FicFile created for each log data 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 changes the location of log files corresponding to an HFSQL data 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. Operations carried out in the log file are no longer recorded.
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:
  • Know the log directory for a data file defined in the data model editor or defined 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.
LogMethodEnables you to identify the logging mode used for a data file (data file defined in the data model editor or dynamically defined).
OperationLogDirectoryAllows you to manage the directory of the log of operations file associated with a log data file. You can:
  • Know the log of operations directory linked to a log data file defined in the data model editor or defined 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: 05/12/2024

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