Permalink
Browse files

attempt to log query+client for startDoResolve exceptions, refs #795

  • Loading branch information...
1 parent 9d539d7 commit 182005e64a894850424902dc722e2fa85e6204a8 @Habbie Habbie committed May 10, 2013
Showing with 7 additions and 4 deletions.
  1. +7 −4 pdns/pdns_recursor.cc
View
@@ -490,8 +490,11 @@ void updateRcodeStats(int res)
void startDoResolve(void *p)
{
DNSComboWriter* dc=(DNSComboWriter *)p;
+ string loginfo="";
try {
+ loginfo=" (while setting loginfo)";
+ loginfo=" ("+dc->d_mdp.d_qname+"/"+lexical_cast<string>(dc->d_mdp.d_qtype)+" from "+(dc->d_remote.toString())+")";
uint32_t maxanswersize= dc->d_tcp ? 65535 : 512;
EDNSOpts edo;
if(getEDNSOpts(dc->d_mdp, &edo)) {
@@ -671,19 +674,19 @@ void startDoResolve(void *p)
dc=0;
}
catch(AhuException &ae) {
- L<<Logger::Error<<"startDoResolve problem: "<<ae.reason<<endl;
+ L<<Logger::Error<<"startDoResolve problem"<<loginfo<<": "<<ae.reason<<endl;
delete dc;
}
catch(MOADNSException& e) {
- L<<Logger::Error<<"DNS parser error: "<<dc->d_mdp.d_qname<<", "<<e.what()<<endl;
+ L<<Logger::Error<<"DNS parser error"<<loginfo<<": "<<dc->d_mdp.d_qname<<", "<<e.what()<<endl;
delete dc;
}
catch(std::exception& e) {
- L<<Logger::Error<<"STL error: "<<e.what()<<endl;
+ L<<Logger::Error<<"STL error"<<loginfo<<": "<<e.what()<<endl;
delete dc;
}
catch(...) {
- L<<Logger::Error<<"Any other exception in a resolver context"<<endl;
+ L<<Logger::Error<<"Any other exception in a resolver context"<<loginfo<<endl;
}
g_stats.maxMThreadStackUsage = max(MT->getMaxStackUsage(), g_stats.maxMThreadStackUsage);

0 comments on commit 182005e

Please sign in to comment.