OpenWrap Server-Side Debugging

Openwrap Server includes a feature to debug requests sent to prebid and all partners, as well as debug responses received from each partner.

When you turn on OpenWrap Server debug, returned responses include a debug object. The debug object contains the resolvedrequest; the OpenRTB request sent by Openwrap to the prebid-server. The resolvedrequest shows all the partner mapping data in the imp.ext object, and you can see the request and response to/from each partner in httpcalls. The sample debug object below shows a response when debug server logs are enabled for your requests:

Sample response with debug
 {
	"debug": {
		"httpcalls": {
			"appnexus": [{
				"requestbody": "{\"id\":\"631e562e-2ea6-4e55-a3f5-61eb32661462\",\"imp\":[{\"id\":\"732018ef-4c8a-4073-8578-909423684284\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":300,\"h\":250},\"tagid\":\"/135812570/ampparit/frontpage/app-mob-1\",\"secure\":1,\"ext\":{\"appnexus\":{\"placement_id\":16256353}}}],\"site\":{\"domain\":\"ebay.com\",\"page\":\"http://ebay.com/amp.html?pwtvc=1\",\"publisher\":{\"id\":\"118184\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36\",\"ip\":\"::1\"},\"at\":1,\"tmax\":489,\"cur\":[\"USD\"],\"source\":{\"tid\":\"631e562e-2ea6-4e55-a3f5-61eb32661462\"},\"ext\":{\"prebid\":{\"aliases\":{\"districtm\":\"appnexus\"},\"debug\":1,\"bidderparams\":{\"pubmatic\":{\"Cookie\":[\"SSCookie=1\"]}}},\"appnexus\":{\"hb_source\":5}}}",
				"responsebody": "",
				"status": 0,
				"uri": "http://pubmatic-uswest.adnxs.com/openrtb2"
			}],
			"pubmatic": [{
				"requestbody": "{\"id\":\"631e562e-2ea6-4e55-a3f5-61eb32661462\",\"imp\":[{\"id\":\"732018ef-4c8a-4073-8578-909423684284\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":300,\"h\":250},\"tagid\":\"/135812570/ampparit/frontpage/app-mob-1\",\"secure\":1}],\"site\":{\"domain\":\"ebay.com\",\"page\":\"http://ebay.com/amp.html?pwtvc=1\",\"publisher\":{\"id\":\"118184\"},\"ext\":{\"amp\":0}},\"device\":{\"ua\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36\",\"ip\":\"::1\"},\"at\":1,\"tmax\":489,\"cur\":[\"USD\"],\"source\":{\"tid\":\"631e562e-2ea6-4e55-a3f5-61eb32661462\"},\"ext\":{\"wrapper\":{\"version\":0,\"profile\":1408}}}",
				"responsebody": "{\"id\":\"631e562e-2ea6-4e55-a3f5-61eb32661462\",\"seatbid\":[{\"bid\":[{\"id\":\"BANNER1-CC2E-48A2-BC83-4DD5F38FE9BB\",\"impid\":\"732018ef-4c8a-4073-8578-909423684284\",\"price\":2.0246701,\"adm\":\"\\u003cspan class=\\\"PubAPIAd\\\"  id=\\\"4E733404-CC2E-48A2-BC83-4DD5F38FE9BB\\\"\\u003e\\u003cscript type=\\\"text/javascript\\\"\\u003e document.writeln('\\u003ciframe width=\\\"300\\\" scrolling=\\\"no\\\" height=\\\"250\\\" frameborder=\\\"0\\\" name=\\\"iframe0\\\" allowtransparency=\\\"true\\\" marginheight=\\\"0\\\" marginwidth=\\\"0\\\" vspace=\\\"0\\\" hspace=\\\"0\\\" src=\\\"https://ads.pubmatic.com/AdTag/300x250.png\\\"\\u003e\\u003c/iframe\\u003e');\\u003c/script\\u003e\\u003ciframe width=\\\"0\\\" scrolling=\\\"no\\\" height=\\\"0\\\" frameborder=\\\"0\\\" src=\\\"https://aktrack.pubmatic.com/AdServer/AdDisplayTrackerServlet?pubId=5890\\\" style=\\\"position:absolute;top:-15000px;left:-15000px\\\" vspace=\\\"0\\\" hspace=\\\"0\\\" marginwidth=\\\"0\\\" marginheight=\\\"0\\\" allowtransparency=\\\"true\\\" name=\\\"pbeacon\\\"\\u003e\\u003c/iframe\\u003e\\u003c/span\\u003e \\u003c!-- PubMatic Ad Ends --\\u003e\",\"adomain\":[\"mystartab.com\"],\"cid\":\"16981\",\"crid\":\"471633211122233344987666\",\"dealid\":\"PUBDEAL1\",\"h\":250,\"w\":300,\"ext\":{\"dspid\":6,\"deal_channel\":1}}],\"seat\":\"4098\"}],\"cur\":\"USD\"}",
				"status": 200,
				"uri": "http://hbopenbid.pubmatic.com/translator?source=pubmatic-server"
			}]
		},
		"resolvedrequest": {
			"at": 1,
			"cur": [
				"USD"
			],
			"device": {
				"ip": "::1",
				"ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
			},
			"ext": {
				"prebid": {
					"aliases": {
						"districtm": "appnexus"
					},
					"bidderparams": {
						"pubmatic": {
							"Cookie": [
								"SSCookie=1"
							]
						}
					},
					"debug": 1
				}
			},
			"id": "631e562e-2ea6-4e55-a3f5-61eb32661462",
			"imp": [{
				"banner": {
					"format": [{
						"h": 250,
						"w": 300
					}]
				},
				"ext": {
					"appnexus": {
						"placementId": 16256353
					},
					"pubmatic": {
						"adSlot": "/135812570/ampparit/frontpage/app-mob-1@300x250",
						"publisherId": "118184",
						"wrapper": {
							"profile": 1408,
							"version": 0
						}
					}
				},
				"id": "732018ef-4c8a-4073-8578-909423684284",
				"secure": 1,
				"tagid": "/135812570/ampparit/frontpage/app-mob-1"
			}],
			"site": {
				"domain": "ebay.com",
				"ext": {
					"amp": 0
				},
				"page": "http://ebay.com/amp.html?pwtvc=1",
				"publisher": {
					"id": "118184"
				}
			},
			"source": {
				"tid": "631e562e-2ea6-4e55-a3f5-61eb32661462"
			},
			"tmax": 489
		}
	}
}

Enabling debug mode for different endpoints

You can turn on debug mode for various types of endpoints. The expandable sections below describe each type and provide an example.

OpenRTB 2.5 endpoint


Use the 2.5 endpoint for Display and In-App profiles. Enable debug mode by passing, debug=1, to the endpoint: 
http://ow.pubmatic.com/openrtb/2.5/?debug=1
AMP endpoint


Turn on debug for the AMP endpoint with, pwtvc=1, in the purl field of the request:
http://ow.pubmatic.com/amp?v=1&w=300&h=250&ms=&auId=%2F135812570%2Fampparit%2Ffrontpage%2Fapp-mob-1
&purl=http%3A%2F%2Febay.com%2Famp.html%3Fpwtvc%3D1
&pubId=118184&profId=1408&

From the sample above, the decoded purl and its setting, http://ebay.com/amp.html?pwtvc=1, enables debug mode.

Video redirect endpoint


Debug a video request with, pwtvc=1, as a query parameter in the video endpoint:
https://ow.pubmatic.com/openrtb/2.5/video?pwtvc=1&pubId=156926&profId=1633&adserver=DFP&pwtplt=video&pwtmime=1
&owredirect=https%3A%2F%2Fpubads.g.doubleclick.net%2Fgampad%2Fads%3Fiu%3D%2F46138097%2Fweb_an_live_tv_preroll
%26description_url%3Dhttps%253A%252F%252Fasianetnews.com%26env%3Dvp%26impl%3Ds%26correlator%3D%26tfcd%3D0%26npa
%3D0%26gdfp_req%3D1%26output%3Dvast%26sz%3D400x300%7C640x480%26unviewed_position_start%3D1%26hl%3Den
CTV OpenRTB endpoint
Debug CTV video by passing, debug=1, to the endpoint:
http://ow.pubmatic.com/video/openrtb/?debug=1

CTV VAST endpoint…

Unsupported at this time.

Debug server logs

  • PubMatic provides detailed application logs to check what is actually happening on server-side. Application logs default to error level reporting. You can turn on debug logs without restarting the server application by using a curl call that sets your desired debug level and the duration for which debug mode will run. Authenticate your curl call using the Authorization field with the -H (header) parameter and pass the Base64 encoded value of your DebugAuthKey from the configuration file. The following sample curl call enables log level 1 for 10 minutes. After 10 minutes, the configuration resets to the default log level:

    curl -v 'http://172.16.8.104:8001/log/?level=1&&duration=10' -H 'Authorization: OThhMjNiNDIzNWM0NQ=='
  • PubMatic's logger package reports errors, warnings, info, and debug level logs based on the LogLevelMaxLogSizeLogRotationTime, and MaxLogFiles values in the configuration file. Your logging configuration might look similar to the sample below:

    Sample log configuration
    [Log]
    LogPath="/var/log/dmhbserver/"
    LogLevel=4 #DEBUG=1, INFO=2, WARN=3, ERROR=4, CRITICAL=5, FATAL=6
    MaxLogSize=2000000000   #size in bytes
    LogRotationTime=60  # time in minutes
    MaxLogFiles=10   # Number of log files to be retained log path
    DebugLogUpdateTime=5   # time in minutes to update new log level
    DebugAuthKey="98a23b4235c45" # Key to verify Authorization while updating log level

⇧ Top

Do you have feedback on this document? Let us know: email us.

Table of Contents