]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Dockerfile: polish request tracing in debug_mode
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 22 Oct 2021 13:26:42 +0000 (15:26 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 27 Oct 2021 13:55:27 +0000 (15:55 +0200)
Since v5.4.0, using both debug level log and request tracing duplicates
lines in the log output. This makes the log more readable while
hopefully keeping all the relevant information there.

etc/config/config.docker

index 84246000aed72adf440021414a08746696746607..0e581d0f0bbebb8af0a38a7fc1e8571dc6c3f0c7 100644 (file)
@@ -61,10 +61,9 @@ function debug_mode(qname, qtype)
 
        -- execute query right after start up and exit when the query is finished
        event.after(0, function()
-               -- ultra verbose log
-               log_level('debug')
+               log_level('info')
                policy.add(policy.all(policy.DEBUG_ALWAYS))
-               log_debug(ffi.C.LOG_GRP_RESOLVER, 'starting DNS query for %s %s', qname, kres.tostring.type[qtype])
+               log_info(ffi.C.LOG_GRP_RESOLVER, 'starting DNS query for %s %s', qname, kres.tostring.type[qtype])
                local starttime = cqueues.monotime()
                resolve({
                        name = qname,
@@ -76,7 +75,7 @@ function debug_mode(qname, qtype)
                                event.after(1, -- milisecond
                                        function()
                                                local endtime = cqueues.monotime()
-                                               log_debug(ffi.C.LOG_GRP_RESOLVER, '\nrequest finished in %f ms', (endtime - starttime) * 1000)
+                                               log_info(ffi.C.LOG_GRP_RESOLVER, 'request finished in %f ms', (endtime - starttime) * 1000)
                                                os.exit()
                                        end)
                                end