From: Michal 'vorner' Vaner Date: Wed, 4 Jan 2012 09:31:29 +0000 (+0100) Subject: [1454] Logging X-Git-Tag: trac2351_base~275^2~7^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25768c5398397bb271e0da9d8be89f545feb620e;p=thirdparty%2Fkea.git [1454] Logging --- diff --git a/src/bin/ddns/ddns.py.in b/src/bin/ddns/ddns.py.in index 47f44350d5..eb4401127e 100755 --- a/src/bin/ddns/ddns.py.in +++ b/src/bin/ddns/ddns.py.in @@ -34,6 +34,7 @@ import signal isc.log.init("b10-ddns") logger = isc.log.Logger("ddns") +DBG_ACTIVITY = logger.DBGLVL_TRACE_BASIC DATA_PATH = bind10_config.DATA_PATH if "B10_FROM_SOURCE" in os.environ: @@ -135,6 +136,7 @@ class DDNSServer: """ socket = self._listen_socket.accept() fileno = socket.fileno() + logger.debug(DBG_ACTIVITY, DDNS_NEW_CONN, fileno) session = isc.util.io.socketsession.SocketSessionReceiver(socket) self._socket_sessions[fileno] = (socket, session) @@ -155,13 +157,15 @@ class DDNSServer: """ Handle incoming event on the socket with given fileno. """ + logger.debug(DBG_ACTIVITY, DDNS_INCOMING, fileno) (socket, session) = self._socket_sessions[fileno] try: request = session.pop() self.handle_request(request) - except isc.util.io.socketsession.SocketSessionError: + except isc.util.io.socketsession.SocketSessionError as se: # No matter why this failed, the connection is in unknown, possibly # broken state. So, we close the socket and remove the session. + logger.warn(DDNS_DROP_CONN, fileno, se) del self._socket_sessions[fileno] socket.close() diff --git a/src/bin/ddns/ddns_messages.mes b/src/bin/ddns/ddns_messages.mes index 36c6ed16a1..c68b72f56f 100644 --- a/src/bin/ddns/ddns_messages.mes +++ b/src/bin/ddns/ddns_messages.mes @@ -32,6 +32,18 @@ configuration manager b10-cfgmgr is not running. The ddns process encountered an error when installing the configuration at startup time. Details of the error are included in the log message. +% DDNS_DROP_CONN dropping connection on file descriptor %1 because of error %2 +There was an error on a connection with the b10-auth server (or whatever +connects to the ddns daemon). This might be OK, for example when the +authoritative server shuts down, the connection would get closed. It also +can mean the system is busy and can't keep up or that the other side got +confused and sent bad data. + +% DDNS_INCOMING incoming activity on file descriptor %1 +A debug message, informing there's some activity on the given file descriptor. +It will be either a request or the file descriptor will be closed. See +following log messages to see what of it. + % DDNS_MODULECC_SESSION_ERROR error encountered by configuration/command module: %1 There was a problem in the lower level module handling configuration and control commands. This could happen for various reasons, but the most likely @@ -39,6 +51,10 @@ cause is that the configuration database contains a syntax error and ddns failed to start at initialization. A detailed error message from the module will also be displayed. +% DDNS_NEW_CONN new connection on file descriptor %1 +Debug message. We received a connection and we are going to start handling +requests from it. + % DDNS_RECEIVED_SHUTDOWN_COMMAND shutdown command received The ddns process received a shutdown command from the command channel and will now shut down.