Debug Log Recording is started via the SET DATABASE PARAMETER command using selector 34 ("debug log recording"). This setting must be set while the database is running. Once the database crashes or is relaunched, the setting will revert back to its default setting. The debug log will not start recording again until the parameter is set using SET DATABASE PARAMETER command.
|SET DATABASE PARAMETER(34;2)|
The first parameter (34) is for Debug Log Recording.
The second parameter is the type of recording: 0 is for disabled, 1 is for normal recording, 2 is for detailed recording.
When the debug log starts recording it will overwrite any logs present in the database.4dbase/logs/ directory. However, it will not start recording until the SET DATABASE PARAMETER(34,2) command is issued because the setting itself does not stick between database restarts; it will only begin logging once the command is issued.
Since the purpose of this command is to log every operation that the database is about to execute, most developers would implement this setting in the On Startup database method which would mean that once the database starts, the debug log would start recording. This is fine for most situations; but people who run their database as a service with the service recovery option set to automatically re-launch the service upon abnormal shutdown may find that this keeps overwriting their previous logs.
So if you are running your database as a service and the service recovery option is set to auto-relaunch the service upon abnormal shutdown; you may want to add additional coding to your On Startup routine (before enabling the debug log via SET DATABASE PARAMETER) should you want to later retrieve those logs such as moving them into a different folder.