4D Blog

Home Product JSON export for Journal

JSON export for Journal

April 12, 2016

Product

In 4D applications, the data file is important, so all the activity of the database is stored in the log file. As you all know, the log file is a vital element for the restoration of your database following an unfortunate contingency. However all the information on the database activity may also be useful for analysis. For example, to check the activity on a table, to see the changes made by a user, and to follow a record’s history.

Now you can extract the log contents into a JSON file using the new command LOG FILE TO JSON.
The LOG FILE TO JSON command provides more information like:

  • Operation type
  • Table name
  • Process name
  • Timestamp
  • Workstation name
  • …

 

For example:
[
{
"operationType":23,
"operationName":"Save seqnum",
"operationNumber":46,
"contextID":37,
"timeStamp":"2015-06-11T09:13:17.138Z",
"sequenceNumber":23,
"tableID":"5AFA15123F991C43B6ACF8B46A914BD0",
"tableName":"elem"
},
{
"operationType":24,
"operationName":"Create record",
"operationNumber":47,
"contextID":37,
"timeStamp":"2015-06-11T09:13:17.138Z",
"dataLen":570,
"recordNumber":7,
"tableID":"5AFA15123F991C43B6ACF8B46A914BD0",
"tableName":"elem",
"fields": {
"1": 9,
"2": "test value",
"3": "2003-03-03T00:00:00.000Z",
"4": "BlobPath: Table 1/Field 4/Data_9ACB28F1A2744FDFA5822B22F18B2E12.png",
"8": "BlobID: 2"
},
"extraData": {
"task_id": 1,
"user_name": "Vanessa Smith",
"user4d_id": 1,
"host_name": "iMac-VSmith-0833",
"task_name": "Application process",
"client_version": -1610541776
},
"primaryKey": "9"
}
]

 

The new command syntax is:
LOG FILE TO JSON ( pathFolder ; {size ; {pathName ; {mode}}} )

  • pathFolder: Pathname of export folder.
  • size: Maximum size of JSON file (in bytes).
  • pathname: Pathname of the log file to be integrated. If undefined, 4D uses the current log file.
  • mode: If empty or 1, the field values are prefixed by the field ID. If 2, the field values are prefixed by the field Name.

 

An example database is available to demonstrate the new functionality:

Example Database

For more details, please take a look at the 4D v15 R4 Upgrade manual.

Discuss

Tags Database, Journal, Programming, Scalability, v15 R4, v16

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 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-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio 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