<p>I'm occasionaly getting the following popup from an AJAX.NET application</p>

<pre>Sys.WebForms.PageRequestManagerServerErrorException: An Unknown error occurred while processing the request on the server. The status code returned from the server was: 12031</pre>

<p>From the <a href="http://support.microsoft.com/kb/193625" rel="noreferrer">Microsoft kb</a> that status code indicates a ERROR_INTERNET_CONNECTION_RESET, but it doesn't state what was the underlying issue the triggered the error in the first place.</p>

<p>How can I log/trace/etc the underlying error that generated the popup?</p>

If you're getting that from an updatePanel, set EnablePartialRendering to false in the ScriptManager for the page, and then it should give you the actual error.
Also, if it only happens occasionally, I've found that it could be a viewstate problem, especially when the page goes a long time (20mins or so) between refreshes.
Otherwise, try some try/catch blocks.  Those are some easy methods.
Hope that helps!