Documentation
Below documentation is part of the BeeBase dictribution and is also available in PDF.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8. Log
In this chapter you find:
8.1 Log table | Internal table used for logging. | |
8.2 Activate logging | How to start and stop logging. | |
8.3 Logging mode | Where log entries go. | |
8.4 Set log file | Setting an external file for logging. | |
8.5 Set log label | Setting a label for new log entries. | |
8.6 Import log | Importing log entries from a file. | |
8.7 Export log | Exporting log entries to a file. | |
8.8 Clear log | Deleting all log entries. | |
8.9 Apply changes | Applying changes from a log file to the project. | |
8.10 View log | How to view all log entries. |
8.1 Log Table
For logging changes to a project, BeeBase uses an internal table named `_Log'. Note the underscore as the first character which indicates that this table is a system table managed by BeeBase that cannot be changed. The table contains the following fields:
Name Description
`_Label' A field that can be set by menu item `Log - Set log label'
or computed by a trigger function with name |
The `_Log' table can be accessed like any other table of a project. For example, a select-from-where query
SELECT * from _Log |
can be run in the query editor for obtaining a list of all changes (see Select-from-where queries and Query editor).
8.2 Activate Logging
By default, logging is not enabled in a project. In order to start logging changes, select menu item `Log - Logging active'. The state of this menu item is stored in the project file, thus, once activated and saved, changes will be kept logging when re-opening the project. De-activate the menu item to stop logging changes.
Note that only for those tables and fields, that have the `Log changes' property set, will changes be logged (see Creating tables and Creating fields). The changes that are logged are adding a new record, deleting a record, or changing a field in a record. For each such action, a new log entry is created and added to the `_Log' table if the logging mode includes logging to the project (see Logging mode). When logging to a file, also log entries for starting a transcation, committing a transaction, or rolling back a transaction are logged.
8.3 Logging Mode
You can set the logging mode in menu item `Log - Logging mode' to one of the following choices:
- `To project': changes are logged to the Project's `_Log' table
(default).
- `To file': changes are logged to an external log file.
- `To project and file': changes are logged to both the Project's
`_Log' table and an external file.
The modes that include logging to an external file are useful for keeping track of changes shall the project file ever get corrupted. See Apply changes for how this can be used for restoring a project from a backup.
8.4 Set Log File
For setting the external log file, choose menu item `Log - Set log file'. This opens a standard file selector for entering a filename. Changes will be appended to this file in case it already exists.
8.5 Set Log Label
The `_Log' table has a field named `_Label' that can be freely set by the project. Choosing menu item `Log - Set log label' opens a dialog for entering the label text.
It is also possible to provide the label through a program function.
The function should have the name logLabel
and is called for each new log entry.
The function does not have any arguments and the returned expression,
converted to a string, is used as the label text.
For more information about this trigger function, see logLabel.
Note that when the function logLabel
exists, menu item
`Log - Set log label' is disabled.
8.6 Import Log
It is possible to import log entries from an external file. This can be useful when older log entries have been deleted from the log. After selecting menu item `Log - Import log' a window is opened that allows importing records in the `_Log' table. See Importing records, for a description on all import options.
8.7 Export Log
When the `_Log' table becomes large, it can be useful to export older log entries to an external file. To do this, choose menu item `Log - Export log'. This opens a window for exporting the records of the `_Log' table to a file. See Exporting records, for a description on all export options.
8.8 Clear Log
For clearing all entries of the log, choose menu item `Log - Clear log'. A typical case for clearing all log entries is when the `_Log' table becomes large. Make sure to export all entries to an external file prior to clearing the log.
8.9 Apply Changes
Menu item `Log - Apply changes' allows to import changes from an external file and apply them to the project. See Importing records, for a description on all import options. Changes that are already present in the project's `_Log' table are skipped.
This feature enables the restoration of a possibly corrupted project from a backup copy using the changes in the logfile. The idea is that since changes are logged to the external logfile, if the project ever gets lost or corrupted then those changes can be applied to a previously created backup copy of the project.
There are two possible strategies that can be used based on the logging mode (see Logging mode):
- `To file': When manually creating a backup copy of a project,
the external logfile should be cleared or deleted,
such that only new changes to the project will be present in the logfile.
When applying the logfile to the backup all changes will be applied.
- `To project and file': The logfile can grow indefinitely
and does not need to be cleared when manullay creating a backup copy of a project.
Changes in the logfile before the backup copy will also be in the
`_Log' table of the backup, and thus, only changes after the backup
will be applied.
8.10 View Log
In order to view the project log, choose menu item `Log - View log'.
If the logging mode (see Logging mode) is `To project' or `To project and file' then the query editor is opened with a pre-defined query that lists all log entries. You can modify the query and its title, and BeeBase will remember the query. For more information, see Query editor.
If the logging mode is `To file' then the external viewer (see External viewer) with the log file is shown.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on September, 30 2024 using texi2html