git.iko.soy/typeable/oauth2-proxy
on master help sign in
Added list of variables for logging formats.
commit2ca2c48bd9bc199047637ad20442e6e2dff682f9 authorMisterWil <wilrader@gmail.com> dateTue 26 Feb 2019, 08:53 (8 years ago) parent45742d3
1 file changed+37−2
README.md+37−2
README.md+37−2
@@ -403,7 +403,19 @@ The default format is configured as follows:
403403{{.Client}} - {{.Username}} [{{.Timestamp}}] [{{.Status}}] {{.Message}}
404404```
405405
406−[See `authLogMessageData` in `logging_handler.go`](./logger/logger.go) for all available variables.
406+Available variables for auth logging:
407+
408+| Variable | Example | Description |
409+| --- | --- | --- |
410+| Client | 74.125.224.72 | The client/remote IP address. Will use the X-Real-IP header it if exists. |
411+| Host | domain.com | The value of the Host header. |
412+| Protocol | HTTP/1.0 | The request protocol. |
413+| RequestMethod | GET | The request method. |
414+| Timestamp | 19/Mar/2015:17:20:19 -0400 | The date and time of the logging event. |
415+| UserAgent | - | The full user agent as reported by the requesting client. |
416+| Username | username@email.com | The email or username of the auth request. |
417+| Status | AuthSuccess | The status of the auth request. See above for details. |
418+| Message | Authenticated via OAuth2 | The details of the auth attempt. |
407419
408420### Request Log Format
409421HTTP request logs will output by default in the below format:
@@ -419,7 +431,22 @@ The default format is configured as follows:
419431{{.Client}} - {{.Username}} [{{.Timestamp}}] {{.Host}} {{.RequestMethod}} {{.Upstream}} {{.RequestURI}} {{.Protocol}} {{.UserAgent}} {{.StatusCode}} {{.ResponseSize}} {{.RequestDuration}}
420432```
421433
422−[See `requestLogMessageData` in `logging_handler.go`](./logger/logger.go) for all available variables.
434+Available variables for request logging:
435+
436+| Variable | Example | Description |
437+| --- | --- | --- |
438+| Client | 74.125.224.72 | The client/remote IP address. Will use the X-Real-IP header it if exists. |
439+| Host | domain.com | The value of the Host header. |
440+| Protocol | HTTP/1.0 | The request protocol. |
441+| RequestDuration | 0.001 | The time in seconds that a request took to process. |
442+| RequestMethod | GET | The request method. |
443+| RequestURI | "/oauth2/auth" | The URI path of the request. |
444+| ResponseSize | 12 | The size in bytes of the response. |
445+| StatusCode | 200 | The HTTP status code of the response. |
446+| Timestamp | 19/Mar/2015:17:20:19 -0400 | The date and time of the logging event. |
447+| Upstream | - | The upstream data of the HTTP request. |
448+| UserAgent | - | The full user agent as reported by the requesting client. |
449+| Username | username@email.com | The email or username of the auth request. |
423450
424451### Standard Log Format
425452All other logging that is not covered by the above two types of logging will be output in this standard logging format. This includes configuration information at startup and errors that occur outside of a session. The default format is below:
@@ -434,6 +461,14 @@ If you require a different format than that, you can configure it with the `-sta
434461[{{.Timestamp}}] [{{.File}}] {{.Message}}
435462```
436463
464+Available variables for standard logging:
465+
466+| Variable | Example | Description |
467+| --- | --- | --- |
468+| Timestamp | 19/Mar/2015:17:20:19 -0400 | The date and time of the logging event. |
469+| File | main.go:40 | The file and line number of the logging statement. |
470+| Message | HTTP: listening on 127.0.0.1:4180 | The details of the log statement. |
471+
437472## Adding a new Provider
438473
439474Follow the examples in the [`providers` package](providers/) to define a new