.\" Generated by Mmark Markdown Processor - mmark.miek.nl .TH "LOG" 7 "August 2026" "atomdns handlers" "atomdns authors" .SH "NAME" .PP \fIlog\fP \- log queries .SH "DESCRIPTION" .PP By just using \fIlog\fP you dump all queries on standard output. Note that for busy servers logging will incur a performance hit. The \fIlog\fP handler only logs properties of the incoming query. .PP Enabling or disabling the \fIlog\fP handler only affects the query logging, any other logging from atomdns will show up regardless. .PP The logging of a running server can be toggled by sending the processs a SIGUSR1 signal. This is a process wide toggle, all logging of all servers is enabled or disabled. .PP When outputting a log line, \fIlog\fP will seach for \fB\fCecs/addr\fR and \fB\fCid/id\fR in the context and will add the values to the log when found. .SH "SYNTAX" .PP .RS .nf log .fi .RE .PP Or optionally if you want to log non\-default values from the context: .PP .RS .nf log { CTX [CTX]... } .fi .RE .PP Where: .IP \(bu 4 \fBCTX\fP is a context key like \fB\fCgeoip/city\fR. A non\-existing context key is silently ignored. Adding default keys (\fB\fCecs/addr\fR and \fB\fCid/id\fR) will error. .PP A typical example looks like this: .PP .RS .nf 2025/10/06 07:25:52 INFO example.org. network=udp remote=::1 port=40689 id=23343 type=MX class=IN name=example.org. size=52 bufsize=1232 opcode=QUERY .fi .RE .PP Which says: .IP \(bu 4 Zone getting the request: \fB\fCexample.org.\fR. .IP \(bu 4 Network: \fB\fCudp\fR. Other options are \fB\fCtcp\fR or \fB\fCunix\fR. .IP \(bu 4 Remote address and port: \fB\fC::1 40689\fR. .IP \(bu 4 Query ID \fB\fC23343\fR. .IP \(bu 4 Question type, question class, incoming question name: \fB\fCMX IN example.org.\fR. .IP \(bu 4 Size in bytes: \fB\fC52\fR. .IP \(bu 4 Advertised UDP buffer: \fB\fC1232\fR. .IP \(bu 4 Opcode: \fB\fCQUERY\fR. .PP Optionally we can also see: .PP .RS .nf 2025/10/06 07:25:52 INFO example.org. id.id=5FOXMDAG6YAHD6R7QOZ4UTX7VQ network=udp remote=::1 port=40689 ecs.addr=198.51.100.0 id=23343 type=MX class=IN name=example.org. size=52 bufsize=1232 opcode=QUERY .fi .RE .IP \(bu 4 \fB\fCecs.addr=....\fR, the ecs address if found in the request, via the \fIecs\fP handler. .IP \(bu 4 \fB\fCid.id=....\fR, the generated request ID, from the \fIid\fP handler. .SH "EXAMPLE" .PP Here we add location data to the request's context, \fIand\fP log that. .PP .RS .nf example.org. { geoip { city testdata/GeoIPCity.dat } log { geoip/city } whoami } .fi .RE .SH "ALSO SEE" .PP signal(7), atomdns\-ecs(7), atomdns\-id(7).