Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions content/ngf/how-to/data-plane-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,48 @@ of a few arguments. {{< /call-out >}}

---

## Configure the data plane log format

NGINX records client requests immediately after each request is processed. You can use the `NginxProxy` resource to dynamically configure the access log format.

The following command creates a basic `NginxProxy` that defines a custom log format `$remote_addr - [$time_local] "$request" $status $body_bytes_sent`:

```yaml
kubectl apply -f - <<EOF
apiVersion: gateway.nginx.org/v1alpha2
kind: NginxProxy
metadata:
name: ngf-proxy-config
spec:
logging:
logFormat:
name: custom_format
format: $remote_addr - [$time_local] "$request" $status $body_bytes_sent
accessLog:
path: /dev/stdout
format: custom_format
EOF
```

You can disable access logging entirely with the following configuration:

```yaml
kubectl apply -f - <<EOF
apiVersion: gateway.nginx.org/v1alpha2
kind: NginxProxy
metadata:
name: ngf-proxy-config
spec:
logging:
accessLog:
path: off
EOF
```

{{< call-out "note" >}} File destinations in `logging.accessLog.path` are not currently supported. Any value other than `off` is replaced with `/dev/stdout`. {{< /call-out >}}

---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ADubhlaoich won't it be confusing since we still have it in this document above and below this new text?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @ADubhlaoich . Up to you to accept or push.


### Run NGINX Gateway Fabric with NGINX in debug mode

To run NGINX Gateway Fabric with NGINX in debug mode, during [installation]({{< ref "/ngf/install/" >}}), follow these additional steps:
Expand Down
Loading