Skip to content

Commit

Permalink
fix docs string for access logs (#1850)
Browse files Browse the repository at this point in the history
make sure user specifies a file name when sink is set to file

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg authored Sep 5, 2023
1 parent f30dc6a commit be0ae51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/config/v1alpha1/accesslogging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const (
)

// ProxyAccessLogFormat defines the format of accesslog.
// By default accesslogs are written to standard output.
// +union
type ProxyAccessLogFormat struct {
// Type defines the type of accesslog format.
// +kubebuilder:validation:Enum=Text;JSON
// +unionDiscriminator
Type ProxyAccessLogFormatType `json:"type,omitempty"`
// Text defines the text accesslog format, following Envoy accesslog formatting,
// empty value results in proxy's default access log format.
// It's required when the format type is "Text".
// Envoy [command operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators) may be used in the format.
// The [format string documentation](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-format-strings) provides more information.
Expand Down Expand Up @@ -79,7 +79,7 @@ type ProxyAccessLogSink struct {

type FileEnvoyProxyAccessLog struct {
// Path defines the file path used to expose envoy access log(e.g. /dev/stdout).
// Empty value disables accesslog.
// +kubebuilder:validation:MinLength=1
Path string `json:"path,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3864,10 +3864,9 @@ spec:
type: object
text:
description: Text defines the text accesslog format,
following Envoy accesslog formatting, empty value
results in proxy's default access log format.
It's required when the format type is "Text".
Envoy [command operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators)
following Envoy accesslog formatting, It's required
when the format type is "Text". Envoy [command
operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators)
may be used in the format. The [format string
documentation](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-format-strings)
provides more information.
Expand All @@ -3890,7 +3889,7 @@ spec:
path:
description: Path defines the file path used
to expose envoy access log(e.g. /dev/stdout).
Empty value disables accesslog.
minLength: 1
type: string
type: object
openTelemetry:
Expand Down
6 changes: 3 additions & 3 deletions docs/latest/api/config_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ _Appears in:_

| Field | Description |
| --- | --- |
| `path` _string_ | Path defines the file path used to expose envoy access log(e.g. /dev/stdout). Empty value disables accesslog. |
| `path` _string_ | Path defines the file path used to expose envoy access log(e.g. /dev/stdout). |


## Gateway
Expand Down Expand Up @@ -729,15 +729,15 @@ _Appears in:_



ProxyAccessLogFormat defines the format of accesslog.
ProxyAccessLogFormat defines the format of accesslog. By default accesslogs are written to standard output.

_Appears in:_
- [ProxyAccessLogSetting](#proxyaccesslogsetting)

| Field | Description |
| --- | --- |
| `type` _[ProxyAccessLogFormatType](#proxyaccesslogformattype)_ | Type defines the type of accesslog format. |
| `text` _string_ | Text defines the text accesslog format, following Envoy accesslog formatting, empty value results in proxy's default access log format. It's required when the format type is "Text". Envoy [command operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators) may be used in the format. The [format string documentation](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-format-strings) provides more information. |
| `text` _string_ | Text defines the text accesslog format, following Envoy accesslog formatting, It's required when the format type is "Text". Envoy [command operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators) may be used in the format. The [format string documentation](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-format-strings) provides more information. |
| `json` _object (keys:string, values:string)_ | JSON is additional attributes that describe the specific event occurrence. Structured format for the envoy access logs. Envoy [command operators](https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#command-operators) can be used as values for fields within the Struct. It's required when the format type is "JSON". |


Expand Down

0 comments on commit be0ae51

Please sign in to comment.