4D v16.3

Appendix E: Description of log files

Home

 
4D v16.3
Appendix E: Description of log files

Appendix E: Description of log files  


 

 

4D applications can generate several log files that are useful for debugging or optimizing their execution. Logs are usually started or stopped using selectors of the SET DATABASE PARAMETER or WEB SET OPTION commands and are stored in the Logs folder of the database (see the Description of 4D files section).

Information logged needs to be analyzed to detect and fix issues. This appendix provides a comprehensive description of the following log files:

  • 4DRequestsLog.txt
  • 4DRequestsLog_ProcessInfo.txt
  • HTTPDebugLog.txt
  • 4DDebugLog.txt

These log files share some fields so that you can establish a chronology and make connections between entries while debugging:

  • sequence_number: this number is unique over all debug logs and is incremented for each new entry whatever the log file, so that you can know the exact sequence of the operations.
  • connection_uuid: for any 4D process created on a 4D client that connects to a server, this connection UUID is logged on both server and client side. It allows you to easily identify the remote client that launched each process.

This log file records standard requests carried out by the 4D Server machine or the 4D remote machine that executed the command (excluding Web requests).

How to start this log:

  • on the server:
     SET DATABASE PARAMETER(4D Server log recording;1) //server side
  • on a client:
     SET DATABASE PARAMETER(Client Log Recording;1) //remote side

Note: This statement also starts the 4DRequestsLog_ProcessInfo.txt log file (see below).

Headers
This file starts with the following headers:

  • Log Session Identifier
  • Hostname of the server that hosts the application
  • User Login Name: login on the OS of the user that ran the 4D application on the server.

Contents
For each request, the following fields are logged:

Field nameDescription
sequence_numberUnique and sequential operation number in the logging session
timeDate and time using 'MM/DD/YY, HH:MM:SS' format
task_idInternal task ID
componentComponent signature (e.g., '4SQLS' or 'dbmg')
process_info_indexCorresponds to the "index" field in 4DRequestsLog_ProcessInfo.txt log, and permits linking a request to a process.
requestRequest ID in C/S or message string for SQL requests or LOG EVENT messages
bytes_inNumber of bytes received
bytes_outNumber of bytes sent
durationTime taken in milliseconds to perform action
task_kindPreemptive or cooperative (respectively 'p' or 'c')
connection_uuidUUID identifier of 4D Client, SQL or HTTP Connection (in connection with the same number in 4DRequestsLog_ProcessInfo.txt)

This log file records information on each process created on the 4D Server machine or the 4D remote machine that executed the command (excluding Web requests).

How to start this log:

  • on the server:
     SET DATABASE PARAMETER(4D Server log recording;1) //server side
  • on a client:
     SET DATABASE PARAMETER(Client Log Recording;1) //remote side

Note: This statement also starts the 4DRequestsLog.txt log file (see above).

Headers
This file starts with the following headers:

  • Log Session Identifier
  • Hostname of the server that hosts the application
  • User Login Name: login on the OS of the user that ran the 4D application on the server.

Contents
For each process, the following fields are logged:

Field nameDescription
sequence_numberUnique and sequential operation number in the logging session
timeDate and time using "MM/DD/YY, HH:MM:SS" format
indexUnique and sequential process number
CDB4DBaseContextDB4D component database context UUID
VTaskIDInternal task ID
server_process_idProcess ID on Server
remote_process_idProcess ID on Client
process_nameProcess name
cIDIdentifier of 4D Connection
uIDIdentifier of 4D Client
IPClient IPv4 address
host_nameClient hostname
user_nameUser Login Name on client
connection_uuidUUID identifier process connection (in connection with the same number in 4DRequestsLog.txt)

This log file records each HTTP request and each response in raw mode. Whole requests, including headers, are logged; optionally, body parts can be logged as well.

How to start this log:

 WEB SET OPTION(Web debug log;wdl enable without body//other values are available

The following fields are logged for both Request and Response:

Field nameDescription
SocketIDID of socket used for communication
PeerIPIPv4 address of host (client)
PeerPortPort used by host (client)
TimeStampTimestamp in milliseconds (since system startup)
ConnectionIDConnection UUID (UUID of VTCPSocket used for communication)
SequenceNumberUnique and sequential operation number in the logging session

This log file records each event occurring at the 4D programming level. Standard mode provides a basic view of events.

How to start this log:

 SET DATABASE PARAMETER(Debug Log Recording;2) //standard

The following fields are logged for each event:  

Column #Description
1Unique and sequential operation number in the logging session
2Elapsed time in milliseconds since log startup
3Process ID (p=xx) and unique process ID (puid=xx)
4Stack level
5Can be Command Name/ Method Name/Message/ Task Start Stop info/Plugin Name, event or Callback/Connection UUID
6Time taken for logging operation in milliseconds (different from 2nd column)

This log file records each event occurring at the 4D programming level in a tabbed, compact format that includes additional information (compared to the standard format).

How to start this log:

 SET DATABASE PARAMETER(Debug Log Recording;2+4) //extended tabbed format

The following fields are logged for each event:  

Column #Description
1Unique and sequential operation number in the logging session
2Elapsed time since log startup in "hh:mm:ss:ms" format (can be preceded by a day counter. For example, if the log was started 3 days ago, the time could be "3+11:58:23:163")
3Process ID
4Unique process ID
5Stack level
6May represent (depending on type entry logged in the 8th column):
  • a Language Command ID (when type=1)
  • a Method Name (when type=2)
  • a combination of pluginIndex;pluginCommand (when type=4, 5, 6 or 7). May contain something like '3;2'
  • a Task Connection UUID (when type=8)
  • or may contain 'starting sequence number' when closing a stack level (this should correspond to the sequence number of the current action's start)
  • 121  15:16:50:777  5  8  0  CallMethod  2  0
    122  15:16:50:777  5  8  1  283  1  0
    123  15:16:50:777  5  8  1  122  -1  0  3
    124  15:16:50:777  5  8  0  121  -2  0  61
    Here in the last line (124), the 6th column's value '121' corresponds to the sequence number of the first line (stack level 0). In the line above (123), the 6th column's value '122' corresponds to the sequence number of the upper line (stack level 1) etc.
    7Parameters passed to commands, methods, or plugins
    8Log operation type. This value may be an absolute value:
    1: Command
    2: Method
    3: Message (sent by LOG EVENT command only)
    4: PluginMessage
    5: PluginEvent
    6: PluginCommand
    7: PluginCallback
    8: Task
    When a value is negative, it only means that it is the closing stack level counterpart (see 8th columns in lines 123 and 124 in the log above).
    9Form event if any; empty in other cases (suppose that column is used when code is executed in a form method or script)
    10Elapsed time in micro seconds of the current logged action; only for the closing stack levels (see 10th columns in lines 123 and 124 in the log above)

     
    PROPERTIES 

    Product: 4D
    Theme: Appendixes

     
    HISTORY 

    New
    Created: 4D v16

     
    ARTICLE USAGE

    4D Design Reference ( 4D v16)
    4D Design Reference ( 4D v16.1)
    4D Design Reference ( 4D v16.3)