4D v15

WEB GET OPTION and WEB SET OPTION

Home

 
4D v15
WEB GET OPTION and WEB SET OPTION

WEB GET OPTION and WEB SET OPTION  


 

 

WEB GET OPTION ( selector ; value )
WEB SET OPTION ( selector ; value )

A new constant is available in 4D v15 for the selector parameter: Web debug log (84).

This selector allows you to get or set the status of the new HTTP request log file for the 4D Web server. When enabled, this file, named "HTTPDebugLog_nn.txt", is saved in the "Logs" folder of the application (nn is the file number). It is useful for debugging issues related to the Web server. It records each request and each response in raw mode. Whole requests, including headers, are logged; optionally, body parts can be logged as well.

When you pass Web debug log in selector, several value options can be get or set, corresponding to the information you want to log. The following new constants are available in the "Web Server" constant theme:

Constant (value)TypeDescription
wdl disable (0)LongintWeb HTTP debug log is disabled
wdl enable without body (1)LongintWeb HTTP debug log is enabled without body parts (body size is provided in this case)
wdl enable with response body (3)LongintWeb HTTP debug log is enabled with body part in response only
wdl enable with request body (5)LongintWeb HTTP debug log is enabled with body part in request only
wdl enable with all body parts (7)LongintWeb HTTP debug log is enabled with body parts in response and request

Note: The HTTP request log file can only be enabled or disabled using the WEB SET OPTION command.

Example  

Enabling the HTTP debug log without body parts:

A log entry looks like this:

# REQUEST
# SocketID: 1592
# PeerIP: 127.0.0.1
# PeerPort: 54912
# TimeStamp: 39089388
GET /4DWEBTEST HTTP/1.1
Connection: Close
Host: 127.0.0.1
User-Agent: 4D_HTTP_Client/0.0.0.0

# RESPONSE
# SocketID: 1592
# PeerIP: 127.0.0.1
# PeerPort: 54912
# TimeStamp: 39089389 (elapsed time: 1 ms)
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: close
Content-Length: 3555
Content-Type: text/plain; charset=UTF-8
Date: Tue, 20 Jan 2015 10:51:29 GMT
Expires: Tue, 20 Jan 2015 10:51:29 GMT
Pragma: no-cache
Server: 4D/14.6.0

[Body Size: 3555]

 
PROPERTIES 

Product: 4D
Theme: Language

 
HISTORY 

 
ARTICLE USAGE

4D v15 - Upgrade (R-release edition) ( 4D v15)

Parent of : WEB GET OPTION and WEB SET OPTION ( 4D v15)