KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Debug Logging a Specific Process
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: September 5, 2023

A feature of 4D that can assist with troubleshooting is the debug log. This feature creates logs of each programming level event that occurs. The problem with the feature is that it can be hard to parse and analyze without tools due to the amount of information collected. Having each event logged can also cause the performance to decrease with the additional overhead of logging the information and writting it to the on disk log.

To remedy this is another feature is the ability to limit the recording to specific processes. The general debug log can be initiated programmatically using the SET DATABASE PARAMETER command with the Debug log recording (34) selector. To limit the recording to a specific process, the SET DATABASE PARAMETER command should be called within that process using the Current process debug log recording (111) selector.
The SET DATABASE PARAMETER takes the selector as the first parameter.
The selectors use the same following same parameters to specify the format of the logs as the second paramter of the SET DATABASE PARAMETERS command.

  • 1 - enables logging using standard mode without parameters, with runtimes
  • 2 - enables logging using standard mode with parameters and runtimes
  • 2+4 - enables logging using tabbed mode with parameters and runtimes
  • 0 - disables logging

The Current process debug log only applies to the scope of the process calling it. The debug log generated will be similar to the one from the standard generic debug log, but will apply a suffix of the process number to the file's name. The contents will also be similar based on the selected mode, but will only contain events from the specified process.

This feature will reduce the amount of logging performed and also limit the added overhead to the specified process. This can help with troubleshooting and make the process less impactful to the performance.