mirror of
https://github.com/coredns/coredns.git
synced 2025-12-20 17:15:10 -05:00
middleware/{log,errors}: output everything to stdout (#684)
Limit the options in both errors and log middleware, just output to stdout and let someone else (journald,docker) care about where to route the logs. This removes syslog and logging to a file. Fixes #573 #602
This commit is contained in:
@@ -6,35 +6,21 @@ TODO: what are errors.
|
||||
## Syntax
|
||||
|
||||
~~~
|
||||
errors [LOGFILE]
|
||||
errors [FILE]
|
||||
~~~
|
||||
|
||||
* **LOGFILE** is the path to the error log file to create (or append to), relative to the current
|
||||
working directory. It can also be `stdout` or `stderr` to write to the console, syslog to write to the
|
||||
system log (except on Windows), or visible to write the error (including full stack trace, if
|
||||
applicable) to the response. Writing errors to the response is NOT advised except in local debug
|
||||
situations. The default is stderr. The above syntax will simply enable error reporting on the
|
||||
server. To specify custom error pages, open a block:
|
||||
|
||||
~~~
|
||||
errors {
|
||||
what where
|
||||
}
|
||||
~~~
|
||||
|
||||
* `what` can only be `log`.
|
||||
* `where` is the path to the log file (as described above) and you can enable rotation to manage the log files.
|
||||
* **FILE** is the log file to create (or append to). The *only* valid name for **FILE** is *stdout*
|
||||
|
||||
## Examples
|
||||
|
||||
Log errors into a file in the parent directory:
|
||||
Log errors to *stdout*.
|
||||
|
||||
~~~
|
||||
errors ../error.log
|
||||
errors
|
||||
~~~
|
||||
|
||||
Make errors visible to the client (for debugging only):
|
||||
Log errors to *stdout*.
|
||||
|
||||
~~~
|
||||
errors visible
|
||||
errors stdout
|
||||
~~~
|
||||
|
||||
Reference in New Issue
Block a user