AGSRequestConfiguration in 200.x

273
1
Jump to solution
03-12-2024 04:10 AM
zdtorok
New Contributor II

There exists a very useful way to debug requests in 100.x, this:

let config = AGSRequestConfiguration.global()
config.debugLogFileURL = URL(fileURLWithPath: "/tmp/arcgis.md")
config.debugLogRequests = true
config.debugLogIncludeRequestHeaders = true
config.debugLogResponses = true
config.debugLogIncludeResponseHeaders = true
config.debugLogResponseTrimThreshold = 500
config.debugLogIgnoreTiledLayerRequests = true

 Is there an equivalent version in 200.x? I checked the documentation but haven't found anything similar.

0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor

Hi @zdtorok,

Please use ConsoleNetworkLogger in 200.x for request logging. You can use following code at the start of the application.

let logger = ConsoleNetworkLogger(requestOptions: [.method, .body, .headers], responseOptions: [.data, .headers])
logger.startLogging()

 

Also, you can use the NetworkLogger protocol to build your own custom network logger.

Hope this helps!

Regards,

Nimesh

View solution in original post

1 Reply
NimeshJarecha
Esri Regular Contributor

Hi @zdtorok,

Please use ConsoleNetworkLogger in 200.x for request logging. You can use following code at the start of the application.

let logger = ConsoleNetworkLogger(requestOptions: [.method, .body, .headers], responseOptions: [.data, .headers])
logger.startLogging()

 

Also, you can use the NetworkLogger protocol to build your own custom network logger.

Hope this helps!

Regards,

Nimesh