KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
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.

Commented by Atanas Atanassov on September 4, 2009 at 5:16 PM
In Client-Server environment this command does not have any effect when is executed on the Client machine. It should be execute on the Server machine.
Commented by Thomas Fitch on August 21, 2009 at 9:57 AM
The Log File is a vital part of 4D's backup strategy. If you do not use the log file you cannot track changes since your last backup, in case of a crash. It is highly suggested not to disable the log file if you are using 4D's built in backup functionality.

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.