Skip to content

Commit 7b69b46

Browse files
committed
USHIFT-5072: Rework configuration. Add format option
1 parent ef63377 commit 7b69b46

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

enhancements/microshift/microshift-router-configuration-errors-logging.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,21 @@ As mentioned in the proposal, there is an entire new section in the configuratio
7272
```yaml
7373
ingress:
7474
httpErrorCodePages: <string>
75-
accessLogging: <Enable/Disable>
76-
httpCaptureHeaders:
77-
request:
78-
- maxLength: <integer. Min 1>
79-
name: <string regex: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$. Must comply with RFC 2616 section 4.2>
80-
response:
81-
- maxLength: <integer. Min 1>
82-
name: <string regex: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$. Must comply with RFC 2616 section 4.2>
83-
httpCaptureCookies:
84-
- matchType: <string. Can be Exact or Prefix>
85-
maxLength: <integer. Min 1, Max 1024>
86-
name: <string regex: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$. Must comply with RFC 6265 section 4.1>
87-
namePrefix: <string regex: ^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$. Must comply with RFC 6265 section 4.1>
75+
accessLogging:
76+
status: <Enabled|Disabled>
77+
format: <string>
78+
httpCaptureHeaders:
79+
request:
80+
- maxLength: <integer>
81+
name: <string>
82+
response:
83+
- maxLength: <integer>
84+
name: <string>
85+
httpCaptureCookies:
86+
- matchType: <Exact|Prefix>
87+
maxLength: <integer>
88+
name: <string>
89+
namePrefix: <string>
8890
```
8991
9092
For more information check each individual section.
@@ -119,10 +121,18 @@ logs from the router.
119121
This approach does not require configuring rsyslogd in the host and is self
120122
contained, not dedicating any resources in case it is not enabled.
121123

122-
Configuring either of `ingress.httpCaptureHeaders` or
123-
`ingress.httpCaptureCookies` will also enable `ingress.accessLogging`.
124+
Configuring either of `ingress.accessLogging.httpCaptureHeaders` or
125+
`ingress.accessLogging.httpCaptureCookies` will also enable `ingress.accessLogging.status`.
124126

125-
`ingress.accessLogging` defaults to `Disable`.
127+
`ingress.accessLogging.status` defaults to `Disabled`.
128+
129+
#### Configuring access log format
130+
`ingress.accessLogging.format` specifies the format of the log message for an
131+
HTTP request. If this field is empty, log messages use the implementation's
132+
default HTTP log format, which is described [here](http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3).
133+
134+
Note that this format only applies to cleartext and encryption terminated
135+
requests.
126136

127137
#### Configuring custom error code pages
128138
To configure custom error code pages the user needs to specify a configmap name
@@ -139,8 +149,8 @@ As of today, only errors for 503 and 404 can be customized.
139149

140150
#### Capturing headers
141151
To configure specific HTTP header capture so they are included in the access
142-
logs the user needs to create entries in `ingress.httpCaptureHeaders`. This
143-
field is a list and allows capturing request and response headers
152+
logs the user needs to create entries in `ingress.accessLogging.httpCaptureHeaders`.
153+
This field is a list and allows capturing request and response headers
144154
independently. Each of the entries in the list has different parameters that
145155
follow. If the list is empty (which is the default value) no headers will be
146156
captured.
@@ -156,18 +166,18 @@ Each element of the list includes:
156166

157167
Both elements have the same fields:
158168
* `maxLength`. Specifies a maximum length for the header value. If a header
159-
value exceeds this length, the value will be truncated in the log message.
169+
value exceeds this length, the value will be truncated in the log message. Minimum value 1.
160170
* `name`. Specifies a header name. Its value must be a valid HTTP header name
161-
as defined in RFC 2616 section 4.2.
171+
as defined in RFC 2616 section 4.2. String regex ```^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$```.
162172

163173
If configured, it is mandatory to include at least `maxLength` and `name`.
164174

165-
`ingress.httpCaptureHeaders` defaults to an empty list.
175+
`ingress.accessLogging.httpCaptureHeaders` defaults to an empty list.
166176

167177
#### Capturing cookies
168178
To configure specific HTTP cookie capture so they are included in the access
169-
logs the user needs to create an entry in `ingress.httpCaptureCookies`. This
170-
field is a list (limited to 1 element) which includes information on which
179+
logs the user needs to create an entry in `ingress.accessLogging.httpCaptureCookies`.
180+
This field is a list (limited to 1 element) which includes information on which
171181
cookie to capture. If the list is empty (which is the default value) no cookies
172182
will be captured.
173183

@@ -177,15 +187,17 @@ In each element of the list we find:
177187
* `maxLength`. Specifies a maximum length of the string that will be logged,
178188
which includes the cookie name, cookie value, and one-character delimiter.
179189
If the log entry exceeds this length, the value will be truncated in the log
180-
message.
190+
message. Minimum value 1, maximum value 1024.
181191
* `name`. Specifies a cookie name. It must be a valid HTTP cookie name as
182-
defined in RFC 6265 section 4.1.
192+
defined in RFC 6265 section 4.1. String regex ```^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$```.
193+
Minimum length 0, maximum length 1024.
183194
* `namePrefix`. Specifies a cookie name prefix. It must be a valid HTTP cookie
184-
name as defined in RFC 6265 section 4.1.
195+
name as defined in RFC 6265 section 4.1. String regex ```^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$```.
196+
Minimum length 0, maximum length 1024.
185197

186198
If configured, it is mandatory to include at least `matchType` and `maxLength`.
187199

188-
`ingress.httpCaptureCookies` defaults to an empty list.
200+
`ingress.accessLogging.httpCaptureCookies` defaults to an empty list.
189201

190202
#### How config options change manifests
191203
Each of the configuration options described above has a direct effect on the
@@ -203,7 +215,7 @@ enhancement.
203215
N/A
204216

205217
## Open Questions
206-
* Do we also allow configuring the access log format?
218+
N/A
207219

208220
## Test Plan
209221
All configuration changes will be included in already existing e2e router

0 commit comments

Comments
 (0)