|
NAMElog - enables query logging to standard output.DESCRIPTIONBy just using log you dump all queries (and parts for the reply) on standard output. Options exist to tweak the output a little. Note that for busy servers logging will incur a performance hit.Enabling or disabling the log plugin only affects the query logging, any other logging from CoreDNS will show up regardless. SYNTAXlog With no arguments, a query log entry is written to stdout in the common log format for all requests. Or if you want/need slightly more control: log [NAMES...] [FORMAT]
You can further specify the classes of responses that get logged: log [NAMES...] [FORMAT] { class CLASSES... }
The classes of responses have the following meaning:
If no class is specified, it defaults to all. LOG FORMATYou can specify a custom log format with any placeholder values. Log supports both request and response placeholders.The following place holders are supported:
The default Common Log Format is: `{remote}:{port} - {>id} "{type} {class} {name} {proto} {size} {>do} {>bufsize}" {rcode} {>rflags} {rsize} {duration}` Each of these logs will be outputted with log.Infof, so a typical example looks like this: [INFO] [::1]:50759 - 29008 "A IN example.org. udp 41 false 4096" NOERROR qr,rd,ra,ad 68 0.037990251s ~~~~ ## Examples Log all requests to stdout ~~~ corefile . { log whoami } Custom log format, for all zones (.) . { log . "{proto} Request: {name} {type} {>id}" } Only log denials (NXDOMAIN and nodata) for example.org (and below) . { log example.org { class denial } } Log all queries which were not resolved successfully in the Combined Log Format. . { log . {combined} { class denial error } } Log all queries on which we did not get errors . { log . { class denial success } } Also the multiple statements can be OR-ed, for example, we can rewrite the above case as following: . { log . { class denial class success } }
Visit the GSP FreeBSD Man Page Interface. |