mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	plugin/log: detail {combined} and {common} (#2422)
These can be used (and are handy), document them. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
		| @@ -27,7 +27,9 @@ log [NAME] [FORMAT] | |||||||
| ~~~ | ~~~ | ||||||
|  |  | ||||||
| * `NAME` is the name to match in order to be logged | * `NAME` is the name to match in order to be logged | ||||||
| * `FORMAT` is the log format to use (default is Common Log Format) | * `FORMAT` is the log format to use (default is Common Log Format), `{common}` is used as a shortcut | ||||||
|  |   for the Common Log Format. You can also use `{combined}` for a format that adds the query opcode | ||||||
|  |   `{>opcode}` to the Common Log Format. | ||||||
|  |  | ||||||
| You can further specify the classes of responses that get logged: | You can further specify the classes of responses that get logged: | ||||||
|  |  | ||||||
| @@ -45,7 +47,8 @@ The classes of responses have the following meaning: | |||||||
| * `denial`: either NXDOMAIN or NODATA (name exists, type does not) | * `denial`: either NXDOMAIN or NODATA (name exists, type does not) | ||||||
| * `error`: SERVFAIL, NOTIMP, REFUSED, etc. Anything that indicates the remote server is not willing to | * `error`: SERVFAIL, NOTIMP, REFUSED, etc. Anything that indicates the remote server is not willing to | ||||||
|     resolve the request. |     resolve the request. | ||||||
| * `all`: the default - nothing is specified. Using of this class means that all messages will be logged whatever we mix together with "all". | * `all`: the default - nothing is specified. Using of this class means that all messages will be | ||||||
|  |   logged whatever we mix together with "all". | ||||||
|  |  | ||||||
| If no class is specified, it defaults to *all*. | If no class is specified, it defaults to *all*. | ||||||
|  |  | ||||||
| @@ -75,8 +78,8 @@ The following place holders are supported: | |||||||
| * `{>opcode}`: query OPCODE | * `{>opcode}`: query OPCODE | ||||||
| * `{/[LABEL]}`: any metadata label is accepted as a place holder if it is enclosed between `{/` and  `}`. | * `{/[LABEL]}`: any metadata label is accepted as a place holder if it is enclosed between `{/` and  `}`. | ||||||
| the place holder will be replaced by the corresponding metadata value or the default value `-` if label is not defined. | the place holder will be replaced by the corresponding metadata value or the default value `-` if label is not defined. | ||||||
|  | * `{common}`: the default Common Log Format. | ||||||
|  | * `{combined}`: the Common Log Format with the query opcode. | ||||||
|  |  | ||||||
| The default Common Log Format is: | The default Common Log Format is: | ||||||
|  |  | ||||||
| @@ -119,11 +122,11 @@ Only log denials for example.org (and below to a file) | |||||||
| } | } | ||||||
| ~~~ | ~~~ | ||||||
|  |  | ||||||
| Log all queries which were not resolved successfully | Log all queries which were not resolved successfully in the Combined Log Format. | ||||||
|  |  | ||||||
| ~~~ corefile | ~~~ corefile | ||||||
| . { | . { | ||||||
|     log . { |     log . {combined} { | ||||||
|         class denial error |         class denial error | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user