@@ -194,6 +194,7 @@ Usage of oauth2_proxy:
194194 -redeem-url string: Token redemption endpoint
195195 -redirect-url string: the OAuth Redirect URL. ie: "https://internalapp.yourcompany.com/oauth2/callback"
196196 -request-logging: Log requests to stdout (default true)
197+ -request-logging-format: Template for request log lines (see "Logging Format" paragraph below)
197198 -resource string: The resource that is protected (Azure AD only)
198199 -scope string: OAuth scope specification
199200 -set-xauthrequest: set X-Auth-Request-User and X-Auth-Request-Email response headers (useful in Nginx auth_request mode)
@@ -331,12 +332,21 @@ following:
331332
332333## Logging Format
333334
334−OAuth2 Proxy logs requests to stdout in a format similar to Apache Combined Log.
335+By default, OAuth2 Proxy logs requests to stdout in a format similar to Apache Combined Log.
335336
336337```
337338<REMOTE_ADDRESS> - <user@domain.com> [19/Mar/2015:17:20:19 -0400] <HOST_HEADER> GET <UPSTREAM_HOST> "/path/" HTTP/1.1 "<USER_AGENT>" <RESPONSE_CODE> <RESPONSE_BYTES> <REQUEST_DURATION>
338339```
339340
341+If you require a different format than that, you can configure it with the `-request-logging-format` flag.
342+The default format is configured as follows:
343+
344+```
345+{{.Client}} - {{.Username}} [{{.Timestamp}}] {{.Host}} {{.RequestMethod}} {{.Upstream}} {{.RequestURI}} {{.Protocol}} {{.UserAgent}} {{.StatusCode}} {{.ResponseSize}} {{.RequestDuration}}
346+```
347+
348+[See `logMessageData` in `logging_handler.go`](./logging_handler.go) for all available variables.
349+
340350## Adding a new Provider
341351
342352Follow the examples in the [`providers` package](providers/) to define a new