BIND 10 #1745: adding pid to auth (and resolver) log ID
BIND 10 Development
do-not-reply at isc.org
Fri Mar 2 18:50:42 UTC 2012
#1745: adding pid to auth (and resolver) log ID
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: defect | Status: new
Priority: major | Milestone: Next-
Component: logging | Sprint-Proposed
Sensitive: 0 | Keywords:
Sub-Project: DNS | Defect Severity: N/A
Estimated Difficulty: 0 | Feature Depending on Ticket:
Total Hours: 0 | Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
An accidental commit reminded me of this: we'll need some way to
distinguish log messages from multiple instances of b10-auth/resolver.
While I debugged troubles with multiple instances (which eventually
turned out to be ASIO bugs), I did this quick hack and found it quite
useful:
{{{
--- a/src/bin/auth/main.cc
+++ b/src/bin/auth/main.cc
@@ -25,6 +25,8 @@
#include <cassert>
#include <iostream>
+#include <boost/lexical_cast.hpp>
+
#include <exceptions/exceptions.h>
#include <util/buffer.h>
@@ -116,7 +118,8 @@ main(int argc, char* argv[]) {
}
// Initialize logging. If verbose, we'll use maximum verbosity.
- isc::log::initLogger(AUTH_NAME,
+ isc::log::initLogger(string(AUTH_NAME) + " (" +
+ boost::lexical_cast<string>(getpid()) + ")",
(verbose ? isc::log::DEBUG : isc::log::INFO),
isc::log::MAX_DEBUG_LEVEL, NULL);
}}}
Although it wouldn't be ideal, I'd suggest doing it for both auth and
resolver for short-to-middle term workaround. I believe it's much
better than producing the non-distinguishable logs.
This should be a very easy task, btw (and I think it's a kind of "bug
fix" as the current situation is really inconvenient).
--
Ticket URL: <http://bind10.isc.org/ticket/1745>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list