From b2423e7602b66d7cdcee85c07bbcad14928aa120 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Fri, 21 Dec 2018 10:31:43 -0500 Subject: Log device interaction and push labeled logs back to controller (#50028) * Add session tracing support for network_cli, netconf and httapi connection * Add `persistent_log_messages` configuration option to log device inteaction in log file for network_cli, netconf and httapi connection type * Log jsonrpc request and response in log file is configuration option is enabled * Update docs to talk about warning shown when persistent_log_messages is on --- bin/ansible-connection | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/ansible-connection b/bin/ansible-connection index 36d2257621..7f35aa981e 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -131,17 +131,18 @@ class ConnectionProcess(object): self.exception = None (s, addr) = self.sock.accept() signal.alarm(0) - signal.signal(signal.SIGALRM, self.command_timeout) while True: data = recv_data(s) if not data: break + self.connection._log_messages("jsonrpc request: %s" % data) signal.alarm(self.connection.get_option('persistent_command_timeout')) resp = self.srv.handle_request(data) signal.alarm(0) + self.connection._log_messages("jsonrpc response: %s" % resp) send_data(s, to_bytes(resp)) s.close() -- cgit v1.2.3