diff --git a/bin/srv.py b/bin/srv.py index 77c3286..52aaff1 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -96,9 +96,9 @@ def log_query(ip_addr, found, topic, user_agent): """ Log processed query and some internal data """ - log_entry = "%s %s %s %s" % (ip_addr, found, topic, user_agent) - with open(CONFIG["path.log.queries"], 'a') as my_file: - my_file.write(log_entry.encode('utf-8')+"\n") + log_entry = "%s %s %s %s\n" % (ip_addr, found, topic, user_agent) + with open(CONFIG["path.log.queries"], 'ab') as my_file: + my_file.write(log_entry.encode('utf-8')) def get_request_ip(req): """