mirror of
https://github.com/caddyserver/website.git
synced 2025-04-28 07:56:16 -04:00
More
This commit is contained in:
parent
a3640d617c
commit
e5dae0bd92
6 changed files with 109 additions and 17 deletions
39
src/docs/markdown/caddyfile/directives/log_append.md
Normal file
39
src/docs/markdown/caddyfile/directives/log_append.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: log_append (Caddyfile directive)
|
||||
---
|
||||
|
||||
# log_append
|
||||
|
||||
Appends a field to the access log for the current request.
|
||||
|
||||
This should be used alongside the [`log` directive](log) which is required to enable access logging in the first place.
|
||||
|
||||
The value may be a static string, or a [placeholder](/docs/caddyfile/concepts#placeholders) which will be replaced with the value of the placeholder at the time of the request.
|
||||
|
||||
|
||||
## Syntax
|
||||
|
||||
```caddy-d
|
||||
log_append [<matcher>] <key> <value>
|
||||
```
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
Display in the logs the area of the site that the request is being served from, either `static` or `dynamic`:
|
||||
|
||||
```caddy
|
||||
example.com {
|
||||
log
|
||||
|
||||
handle /static* {
|
||||
log_append area "static"
|
||||
respond "Static response!"
|
||||
}
|
||||
|
||||
handle {
|
||||
log_append area "dynamic"
|
||||
reverse_proxy localhost:9000
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue