4D Blog

Home Product Better debug logs with these improvements

Better debug logs with these improvements

June 4, 2019

Product

As a 4D developer, you may have already activated the debug log to troubleshoot problems. 4D v17 R5 introduces several improvements to help you analyze these files, such as logging only the current process and logging calls to member methods (collection or object methods).

New selector for process logging

The SET DATABASE PARAMETER command now accepts a new selector, Current process debug log recording. Called from any part of a process, it will start logging just for the current process and create a “4DDebugLog_pX_Y.txt” file in the 4D logs folder (where X is the process PUID and Y the sequence file number). Of course, you can also get the process debug log state using this new selector with the Get database parameter command.

SET DATABASE PARAMETER(Current process debug log recording;2+4+8)

You can continue to use the Debug log recording selector to record logs of the activity of all processes, excluding the processes logged by Current process debug log recording.

Reminder: you can easily access the debug logs using this line of code:

SHOW ON DISK(Get 4D folder(Logs folder))

In the screenshot below, you can see the logs generated by five processes:

Keep in mind that since the SET DATABASE PARAMETER is not thread safe, the process will start in cooperative mode.

member METHODS logging

By default, the debug logs now include calls to member methods. They’re logged with command type number 9. If you don’t want the member methods included, just call the SET DATABASE PARAMETER command and the Debug log recording or Current process debug log recording selectors with a new option which has the value 32. You still can combine the options to obtain the debug logs you want.

This example shows how to log the WiFi and Ethernet interfaces in separate collections:

SET DATABASE PARAMETER(Current process debug log recording;2+4+8)
C_COLLECTION($_networkInterfaces;$_ethernet;$_wifi)
$_networkInterfaces:=Get system info.networkInterfaces
$_ethernet:=$_networkInterfaces.query("type = :1";"ethernet")
$_wifi:=$_networkInterfaces.query("type = :1";"wifi")
SET DATABASE PARAMETER(Current process debug log recording;0)

The code returns: 

blank

More security

Previously when launching logs, files were generated until there was no more disk space available. To avoid errors or accidental activation on the 4D Server Administration Window – which could be dangerous – the number of generated files is limited to 50 by default. You can modify this limit via the SET DATABASE PARAMETER command and the Circular log limitation selector.

// Limit the number of logs files to 100 (the default number is set to 50)
SET DATABASE PARAMETER(Circular log limitation;100)

Discuss

Tags Logs, v17 R5, v18

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

Avatar
Damien Fuzeau
- Product Owner - Damien Fuzeau joined the 4D Product team in February 2019. As a Product Owner, he is responsible for writing user stories and translating them into functional specifications. His role also involves ensuring that the delivered feature implementations meet customer needs. Damien holds a degree in Software Engineering from the University of Nantes. He spent over 23 years at his previous company, first as a developer (discovering 4D in 1997), and later as Engineering Manager and Software Architect. The company was an OEM partner of 4D and deployed enterprise software based on 4D for thousands of users across hundreds of servers. Damien is therefore well-versed in 4D development and deployment in multilingual environments.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy