Tech Tip: How to programmatically disable the use of 4D's Log File
PRODUCT: 4D | VERSION: 11.4 | PLATFORM: Mac & Win
Published On: August 20, 2009
You can programmatically turn off 4D's Log File with the following code snippet:
SELECT LOG FILE(*) |
This is normally used to close the current log file before creating a new one, but if a new log file is not created, then the Log File function is effectively turned off. In this case you can see in the 4D Preferences, under the Backup heading, that the Use Log File box is no longer checked.
To ensure the log file is not turned back on, you can block logging by putting this call in the On Backup Shutdown database method. This is because the Log File is turned back on after the next backup. If instead it is turned off (with the line of code above) then the Preference is un-checked and the Log File cannot be turned back on.
That said, activating the log file can sometimes slow your application down. Each transaction must be recorded and the I/O sometimes does slow down the database. It is for this reason that you might want to disable the log file in some situations.